From cd471158a5641e90dd9a22ec6fdee7d07737896e Mon Sep 17 00:00:00 2001 From: Jon Goldberg Date: Mon, 28 Nov 2022 18:14:21 -0500 Subject: [PATCH] fix numfmt error when pager limit is set in Civi settings --- .../Civi/Api4/Event/Subscriber/DefaultDisplaySubscriber.php | 2 +- ext/search_kit/Civi/Search/Admin.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ext/search_kit/Civi/Api4/Event/Subscriber/DefaultDisplaySubscriber.php b/ext/search_kit/Civi/Api4/Event/Subscriber/DefaultDisplaySubscriber.php index 2f34a7ab00dc..c40f3ec251b6 100644 --- a/ext/search_kit/Civi/Api4/Event/Subscriber/DefaultDisplaySubscriber.php +++ b/ext/search_kit/Civi/Api4/Event/Subscriber/DefaultDisplaySubscriber.php @@ -114,7 +114,7 @@ public static function fallbackDefault(GenericHookEvent $e) { $e->display['settings'] += [ 'description' => $e->savedSearch['description'] ?? NULL, 'sort' => [], - 'limit' => \Civi::settings()->get('default_pager_size'), + 'limit' => (int) \Civi::settings()->get('default_pager_size'), 'pager' => [ 'show_count' => TRUE, 'expose_limit' => TRUE, diff --git a/ext/search_kit/Civi/Search/Admin.php b/ext/search_kit/Civi/Search/Admin.php index a0f8b7c280d0..1cd3d6917bde 100644 --- a/ext/search_kit/Civi/Search/Admin.php +++ b/ext/search_kit/Civi/Search/Admin.php @@ -44,7 +44,7 @@ public static function getAdminSettings():array { 'functions' => self::getSqlFunctions(), 'displayTypes' => Display::getDisplayTypes(['id', 'name', 'label', 'description', 'icon']), 'styles' => \CRM_Utils_Array::makeNonAssociative(self::getStyles()), - 'defaultPagerSize' => \Civi::settings()->get('default_pager_size'), + 'defaultPagerSize' => (int) \Civi::settings()->get('default_pager_size'), 'defaultDisplay' => SearchDisplay::getDefault(FALSE)->setSavedSearch(['id' => NULL])->execute()->first(), 'modules' => $extensions, 'defaultContactType' => \CRM_Contact_BAO_ContactType::basicTypeInfo()['Individual']['name'] ?? NULL,