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>
(cherry picked from commit 01543503ce)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
This commit is contained in:
David Cook 2025-06-27 00:45:27 +00:00 committed by Paul Derscheid
parent 37374e7134
commit 4e80ff5004
No known key found for this signature in database
GPG Key ID: C25F9FD44CED595B
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;