From 0bf900f1b649dd9eda21e4ad60fa13064590bc71 Mon Sep 17 00:00:00 2001 From: Nick O'Connor Date: Fri, 31 May 2024 10:24:47 -0700 Subject: [PATCH] Fix search function The behavior of rcube_result_set->next() was changed upstream. This fixes enumeration within the search() function. --- src/Addressbook.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/Addressbook.php b/src/Addressbook.php index ba322926..a1be1f63 100644 --- a/src/Addressbook.php +++ b/src/Addressbook.php @@ -336,10 +336,8 @@ public function search($fields, $value, $mode = 0, $select = true, $nocount = fa $this->page_size = $pageSizeBackup; } - while ( - /** @var ?SaveData $save_data */ - $save_data = $result->next() - ) { + /** @var ?SaveData $save_data */ + foreach ($result as $save_data) { if ($this->checkPostSearchFilter($save_data, $required, $allMustMatch, $postSearchFilter, $mode)) { /** @var array{ID: string} $save_data */ $ids[] = $save_data["ID"];