summaryrefslogtreecommitdiffstats
path: root/apps/dav/lib/CardDAV/CardDavBackend.php
diff options
context:
space:
mode:
Diffstat (limited to 'apps/dav/lib/CardDAV/CardDavBackend.php')
-rw-r--r--apps/dav/lib/CardDAV/CardDavBackend.php17
1 files changed, 10 insertions, 7 deletions
diff --git a/apps/dav/lib/CardDAV/CardDavBackend.php b/apps/dav/lib/CardDAV/CardDavBackend.php
index 3e360fb2e41..98e85096b3b 100644
--- a/apps/dav/lib/CardDAV/CardDavBackend.php
+++ b/apps/dav/lib/CardDAV/CardDavBackend.php
@@ -1130,15 +1130,18 @@ class CardDavBackend implements BackendInterface, SyncSupport {
return (int)$match['cardid'];
}, $matches);
- $query = $this->db->getQueryBuilder();
- $query->select('c.addressbookid', 'c.carddata', 'c.uri')
- ->from($this->dbCardsTable, 'c')
- ->where($query->expr()->in('c.id', $query->createNamedParameter($matches, IQueryBuilder::PARAM_INT_ARRAY)));
+ $cards = [];
+ foreach (array_chunk($matches, 1000) as $matche) {
+ $query = $this->db->getQueryBuilder();
+ $query->select('c.addressbookid', 'c.carddata', 'c.uri')
+ ->from($this->dbCardsTable, 'c')
+ ->where($query->expr()->in('c.id', $query->createNamedParameter($matche, IQueryBuilder::PARAM_INT_ARRAY)));
- $result = $query->execute();
- $cards = $result->fetchAll();
+ $result = $query->execute();
+ $cards = array_merge($cards, $result->fetchAll());
+ $result->closeCursor();
+ }
- $result->closeCursor();
return array_map(function ($array) {
$array['addressbookid'] = (int) $array['addressbookid'];