diff options
author | Joas Schilling <coding@schilljs.com> | 2021-06-01 09:15:34 +0200 |
---|---|---|
committer | szaimen (Rebase PR Action) <szaimen@e.mail.de> | 2021-09-23 08:37:51 +0000 |
commit | 8e7eea935ad18c0b8f7b7c8a3216e4272a2e68ed (patch) | |
tree | 90168c8544b8bff065e315550b433b8f97d5024c /lib | |
parent | f325a4ae60de112a8449faf33f62a916bbcdea28 (diff) | |
download | nextcloud-server-8e7eea935ad18c0b8f7b7c8a3216e4272a2e68ed.tar.gz nextcloud-server-8e7eea935ad18c0b8f7b7c8a3216e4272a2e68ed.zip |
Fix populating the array and closing the cursors
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/private/Comments/Manager.php | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/private/Comments/Manager.php b/lib/private/Comments/Manager.php index ea8f6ea6da4..93b5ed4cc42 100644 --- a/lib/private/Comments/Manager.php +++ b/lib/private/Comments/Manager.php @@ -654,16 +654,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; } |