From: Mikael Nordfeldth Date: Tue, 15 Jul 2014 16:54:42 +0000 (+0200) Subject: Replies caused column name collision on joinAdd X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=d6cc13ac337e3c8d59581ca3fd280460c088251a;p=quix0rs-gnu-social.git Replies caused column name collision on joinAdd --- diff --git a/lib/replynoticestream.php b/lib/replynoticestream.php index 43e378c1be..2c66fb3b3c 100644 --- a/lib/replynoticestream.php +++ b/lib/replynoticestream.php @@ -82,7 +82,11 @@ class RawReplyNoticeStream extends NoticeStream function getNoticeIds($offset, $limit, $since_id, $max_id) { $reply = new Reply(); - $reply->profile_id = $this->userId; + + $reply->selectAdd(); + $reply->selectAdd('notice_id'); + + $reply->whereAdd(sprintf('reply.profile_id = %u', $this->userId)); Notice::addWhereSinceId($reply, $since_id, 'notice_id', 'modified'); Notice::addWhereMaxId($reply, $max_id, 'notice_id', 'modified'); @@ -92,7 +96,7 @@ class RawReplyNoticeStream extends NoticeStream $reply->whereAddIn('notice.verb', $this->selectVerbs, 'string'); } - $reply->orderBy('modified DESC, notice_id DESC'); + $reply->orderBy('reply.modified DESC, reply.notice_id DESC'); if (!is_null($offset)) { $reply->limit($offset, $limit);