From d6cc13ac337e3c8d59581ca3fd280460c088251a Mon Sep 17 00:00:00 2001 From: Mikael Nordfeldth Date: Tue, 15 Jul 2014 18:54:42 +0200 Subject: [PATCH] Replies caused column name collision on joinAdd --- lib/replynoticestream.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) 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); -- 2.39.5