Merge pull request #9272 from nextcloud/bugfix/noid/save-a-query-help-saving-the-world

Only query last comment info, when there is one
This commit is contained in:
Daniel Calviño Sánchez 2018-04-23 16:43:09 +02:00 committed by GitHub
commit 9b150001ff
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -407,11 +407,11 @@ class Manager implements ICommentsManager {
$query->setMaxResults($limit); $query->setMaxResults($limit);
} }
$lastKnownComment = $this->getLastKnownComment( $lastKnownComment = $lastKnownCommentId > 0 ? $this->getLastKnownComment(
$objectType, $objectType,
$objectId, $objectId,
$lastKnownCommentId $lastKnownCommentId
); ) : null;
if ($lastKnownComment instanceof IComment) { if ($lastKnownComment instanceof IComment) {
$lastKnownCommentDateTime = $lastKnownComment->getCreationDateTime(); $lastKnownCommentDateTime = $lastKnownComment->getCreationDateTime();
if ($sortDirection === 'desc') { if ($sortDirection === 'desc') {