Skip to content

Commit

Permalink
Merge pull request #27116 from colemanw/search_autocomplete_count
Browse files Browse the repository at this point in the history
Bump search_autocomplete_count default from 10 to 15
  • Loading branch information
eileenmcnaughton authored Aug 22, 2023
2 parents 9b1daec + 0247932 commit 024180e
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Civi/Api4/Generic/AutocompleteAction.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion settings/Search.setting.php
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
1 change: 1 addition & 0 deletions tests/phpunit/api/v4/Action/AutocompleteTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 024180e

Please sign in to comment.