]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Replies caused column name collision on joinAdd
authorMikael Nordfeldth <mmn@hethane.se>
Tue, 15 Jul 2014 16:54:42 +0000 (18:54 +0200)
committerMikael Nordfeldth <mmn@hethane.se>
Tue, 15 Jul 2014 16:54:42 +0000 (18:54 +0200)
lib/replynoticestream.php

index 43e378c1be2df09bcc0b03a7eb93ca425b5c8ebe..2c66fb3b3c1990c51b72ca3650332112d9e9cd40 100644 (file)
@@ -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);