Skip to content

Commit

Permalink
Fix: #4476 - Given initial lists fail for German surnames with umlauts
Browse files Browse the repository at this point in the history
  • Loading branch information
fisharebest committed Mar 4, 2023
1 parent 2f3bd79 commit fa73924
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion app/Module/IndividualListModule.php
Expand Up @@ -41,14 +41,18 @@
use function app;
use function array_filter;
use function array_keys;
use function array_map;
use function array_merge;
use function array_sum;
use function array_values;
use function assert;
use function e;
use function implode;
use function ob_get_clean;
use function ob_start;
use function route;
use function uksort;
use function usort;
use function view;

use const ARRAY_FILTER_USE_KEY;
Expand Down Expand Up @@ -421,8 +425,11 @@ protected function createResponse(Tree $tree, UserInterface $user, array $params
if ($count < $tree->getPreference('SUBLIST_TRIGGER_I')) {
$falpha = '';
} else {
$givn_initials = $this->givenNameInitials($tree, array_keys($surns), $show_marnm === 'yes', $families);
// Break long lists by initial letter of given name
$surns = array_values(array_map(static fn($x): array => array_keys($x), $surns));
$surns = array_merge(...$surns);
$givn_initials = $this->givenNameInitials($tree, $surns, $show_marnm === 'yes', $families);

if ($surname !== '' || $show_all) {
if (!$show_all) {
echo '<h2 class="wt-page-title">', I18N::translate('Individuals with surname %s', $legend), '</h2>';
Expand Down

0 comments on commit fa73924

Please sign in to comment.