From b2796754d9642a59d746030dc6ef3acd9c2aab30 Mon Sep 17 00:00:00 2001 From: Greg Roach Date: Sat, 4 Nov 2023 23:49:15 +0000 Subject: [PATCH] Fix: #4900 - cannot disable sublists on individual list page --- app/Module/IndividualListModule.php | 3 ++- resources/views/admin/trees-preferences.phtml | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/app/Module/IndividualListModule.php b/app/Module/IndividualListModule.php index 2a52d42bb83..794a4869bba 100644 --- a/app/Module/IndividualListModule.php +++ b/app/Module/IndividualListModule.php @@ -409,7 +409,8 @@ public function handle(ServerRequestInterface $request): ResponseInterface $count = array_sum(array_map(static fn(array $x): int => array_sum($x), $all_surnames)); // Don't sublist short lists. - if ($count < $tree->getPreference('SUBLIST_TRIGGER_I')) { + $sublist_threshold = (int) $tree->getPreference('SUBLIST_TRIGGER_I'); + if ($sublist_threshold === 0 || $count < $sublist_threshold) { $falpha = ''; } else { // Break long lists by initial letter of given name diff --git a/resources/views/admin/trees-preferences.phtml b/resources/views/admin/trees-preferences.phtml index 8e2db67b93a..15889aa2438 100644 --- a/resources/views/admin/trees-preferences.phtml +++ b/resources/views/admin/trees-preferences.phtml @@ -351,10 +351,11 @@ use Illuminate\Support\Collection;