diff --git a/Civi/Api4/Generic/AutocompleteAction.php b/Civi/Api4/Generic/AutocompleteAction.php index 7a70d4d2fefa..313f6a67ab35 100644 --- a/Civi/Api4/Generic/AutocompleteAction.php +++ b/Civi/Api4/Generic/AutocompleteAction.php @@ -168,7 +168,7 @@ public function _run(Result $result) { if (!empty($this->display['settings']['columns'][0]['rewrite'])) { $searchFields = array_merge($searchFields, $this->getTokens($this->display['settings']['columns'][0]['rewrite'])); } - $this->display['settings']['limit'] = $this->display['settings']['limit'] ?? \Civi::settings()->get('search_autocomplete_count') ?: 10; + $this->display['settings']['limit'] = $this->display['settings']['limit'] ?? \Civi::settings()->get('search_autocomplete_count'); $this->display['settings']['pager'] = []; $return = 'scroll:' . $this->page; // SearchKit treats comma-separated fieldnames as OR clauses diff --git a/settings/Search.setting.php b/settings/Search.setting.php index 62a97d836297..cb5988fd3595 100644 --- a/settings/Search.setting.php +++ b/settings/Search.setting.php @@ -25,7 +25,7 @@ 'type' => 'Integer', 'quick_form_type' => 'Element', 'html_type' => 'number', - 'default' => 10, + 'default' => 15, 'add' => '4.3', 'title' => ts('Autocomplete Results'), 'is_domain' => 1, diff --git a/tests/phpunit/api/v4/Action/AutocompleteTest.php b/tests/phpunit/api/v4/Action/AutocompleteTest.php index 048ded69560d..415b7919de81 100644 --- a/tests/phpunit/api/v4/Action/AutocompleteTest.php +++ b/tests/phpunit/api/v4/Action/AutocompleteTest.php @@ -200,6 +200,7 @@ public function testAutocompleteValidation() { } public function testAutocompletePager() { + \Civi::settings()->set('search_autocomplete_count', 10); MockBasicEntity::delete()->addWhere('identifier', '>', 0)->execute(); $sampleData = []; foreach (range(1, 21) as $num) {