Skip to content

Commit fa73924

Browse files
committed
Fix: #4476 - Given initial lists fail for German surnames with umlauts
1 parent 2f3bd79 commit fa73924

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

app/Module/IndividualListModule.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,14 +41,18 @@
4141
use function app;
4242
use function array_filter;
4343
use function array_keys;
44+
use function array_map;
45+
use function array_merge;
4446
use function array_sum;
47+
use function array_values;
4548
use function assert;
4649
use function e;
4750
use function implode;
4851
use function ob_get_clean;
4952
use function ob_start;
5053
use function route;
5154
use function uksort;
55+
use function usort;
5256
use function view;
5357

5458
use const ARRAY_FILTER_USE_KEY;
@@ -421,8 +425,11 @@ protected function createResponse(Tree $tree, UserInterface $user, array $params
421425
if ($count < $tree->getPreference('SUBLIST_TRIGGER_I')) {
422426
$falpha = '';
423427
} else {
424-
$givn_initials = $this->givenNameInitials($tree, array_keys($surns), $show_marnm === 'yes', $families);
425428
// Break long lists by initial letter of given name
429+
$surns = array_values(array_map(static fn($x): array => array_keys($x), $surns));
430+
$surns = array_merge(...$surns);
431+
$givn_initials = $this->givenNameInitials($tree, $surns, $show_marnm === 'yes', $families);
432+
426433
if ($surname !== '' || $show_all) {
427434
if (!$show_all) {
428435
echo '<h2 class="wt-page-title">', I18N::translate('Individuals with surname %s', $legend), '</h2>';

0 commit comments

Comments
 (0)