Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes: #5002 - individual list, given names starting with di-graphs not included #5013

Merged
merged 3 commits into from
Aug 7, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 3 additions & 6 deletions app/Module/AbstractIndividualListModule.php
Original file line number Diff line number Diff line change
Expand Up @@ -382,9 +382,7 @@
$givn_initials = $this->givenNameInitials($tree, $all_surnames, $show_marnm === 'yes', $this->showFamilies());

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

Check warning on line 385 in app/Module/AbstractIndividualListModule.php

View check run for this annotation

Codecov / codecov/patch

app/Module/AbstractIndividualListModule.php#L385

Added line #L385 was not covered by tests
// Don't show the list until we have some filter criteria
$show = $falpha !== '' || $show_all_firstnames === 'yes' ? 'indi' : 'none';
echo '<ul class="d-flex flex-wrap list-unstyled justify-content-center wt-initials-list wt-initials-list-given-names">';
Expand Down Expand Up @@ -719,16 +717,15 @@

// The name from the database may be private - check the filtered list...
foreach ($individual->getAllNames() as $n => $name) {
if ($name['givn'] === $row->n_givn && $name['surn'] === $row->n_surn) {
if ($galpha === '' || I18N::strtoupper(I18N::language()->initialLetter($row->n_givn)) === $galpha) {
if ($name['givn'] === $row->n_givn && $name['surn'] === $row->n_surn)
if ($galpha === '' || I18N::language()->initialLetter(I18N::language()->normalize(I18N::strtoupper($row->n_givn))) === $galpha) {
$individual->setPrimaryName($n);
// We need to clone $individual, as we may have multiple references to the
// same individual in this list, and the "primary name" would otherwise
// be shared amongst all of them.
$individuals->push(clone $individual);
break;
}
}
}
}

Expand Down
Loading