Bug 36947: (QA follow-up) Fix locale-list to show selected values

Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
This commit is contained in:
David Cook 2025-06-27 00:45:27 +00:00 committed by Lucas Gass
parent c0546d4c22
commit 01543503ce
No known key found for this signature in database
GPG Key ID: 60B447398B0D36CA
1 changed files with 7 additions and 1 deletions

View File

@ -126,7 +126,13 @@ sub _get_chunk {
# Dynamic locale detection for facet sorting using Koha::I18N
require Koha::I18N;
$chunk->{'CHOICES'} = Koha::I18N::available_locales();
my $locales = Koha::I18N::available_locales();
foreach my $locale (@$locales) {
if ( $locale->{value} && $value && $locale->{value} eq $value ) {
$locale->{selected} = 1;
}
}
$chunk->{'CHOICES'} = $locales;
$chunk->{'type'} = 'select';
} elsif ( $options{'choices'} ) {
my $add_blank;