aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2021-06-01 09:15:34 +0200
committerJoas Schilling <coding@schilljs.com>2021-06-01 09:15:34 +0200
commitc0c5340f4eebe790d6193cca46bc48fe7ce79f6d (patch)
tree60b59e03137eda1a3f23d165136abc6503204590
parentf2101487a0a32cd5be5068329a2c7cd6d8a1583f (diff)
downloadnextcloud-server-c0c5340f4eebe790d6193cca46bc48fe7ce79f6d.tar.gz
nextcloud-server-c0c5340f4eebe790d6193cca46bc48fe7ce79f6d.zip
Fix populating the array and closing the cursors
Signed-off-by: Joas Schilling <coding@schilljs.com>
-rw-r--r--lib/private/Comments/Manager.php6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/private/Comments/Manager.php b/lib/private/Comments/Manager.php
index 8cd8fc57b3d..beaab9535ac 100644
--- a/lib/private/Comments/Manager.php
+++ b/lib/private/Comments/Manager.php
@@ -655,16 +655,16 @@ class Manager implements ICommentsManager {
$query->andWhere($query->expr()->eq('c.verb', $query->createNamedParameter($verb)));
}
+ $unreadComments = array_fill_keys($objectIds, 0);
foreach (array_chunk($objectIds, 1000) as $chunk) {
$query->setParameter('ids', $chunk, IQueryBuilder::PARAM_INT_ARRAY);
- $result = $query->execute();
- $unreadComments += array_fill_keys($objectIds, 0);
+ $result = $query->executeQuery();
while ($row = $result->fetch()) {
$unreadComments[$row['object_id']] = (int) $row['num_comments'];
}
+ $result->closeCursor();
}
- $result->closeCursor();
return $unreadComments;
}