From 3d4224a090d07425fa2c0e4ed114a3326ccdab4a Mon Sep 17 00:00:00 2001 From: LEDfan Date: Sun, 7 Sep 2014 10:34:25 +0200 Subject: [PATCH] This should solve the 404 error --- lib/hooks.php | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/lib/hooks.php b/lib/hooks.php index ac9695d0..db64d64c 100644 --- a/lib/hooks.php +++ b/lib/hooks.php @@ -190,20 +190,19 @@ class Hooks{ foreach ($addressBookInfos as $addressBookInfo) { $addressBook = new AddressBook($backend, $addressBookInfo); - while ($contacts = $addressBook->getChildren($limit, $offset, false)) { - \OCP\Util::writeLog('contacts', - __METHOD__ . ', indexing: ' . $limit . ' starting from ' . $offset, - \OCP\Util::DEBUG); - foreach ($contacts as $contact) { - if(!$contact->retrieve()) { - \OCP\Util::writeLog('contacts', - __METHOD__ . ', Error loading contact ' .print_r($contact, true), - \OCP\Util::DEBUG); - } - Utils\Properties::updateIndex($contact->getId(), $contact); + $contacts = $addressBook->getChildren($limit, $offset, false); + \OCP\Util::writeLog('contacts', + __METHOD__ . ', indexing: ' . $limit . ' starting from ' . $offset, + \OCP\Util::DEBUG); + foreach ($contacts as $contact) { + if(!$contact->retrieve()) { + \OCP\Util::writeLog('contacts', + __METHOD__ . ', Error loading contact ' .print_r($contact, true), + \OCP\Util::DEBUG); } - $offset += $limit; + Utils\Properties::updateIndex($contact->getId(), $contact); } + $offset += $limit; } }