Skip to content

Commit

Permalink
Fix: #4900 - cannot disable sublists on individual list page
Browse files Browse the repository at this point in the history
  • Loading branch information
fisharebest committed Nov 4, 2023
1 parent 821e328 commit b279675
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
3 changes: 2 additions & 1 deletion app/Module/IndividualListModule.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 3 additions & 2 deletions resources/views/admin/trees-preferences.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -351,10 +351,11 @@ use Illuminate\Support\Collection;
<input
class="form-control"
id="SUBLIST_TRIGGER_I"
maxlength="5"
max="99999"
min="0"
name="SUBLIST_TRIGGER_I"
required
type="text"
type="number"
value="<?= e($tree->getPreference('SUBLIST_TRIGGER_I')) ?>"
>
<div class="form-text">
Expand Down

0 comments on commit b279675

Please sign in to comment.