Koha-clms/cataloguing
Jonathan Druart 5059a0b360
Bug 41989: Call getlanguage after get_template_and_user
This patch prevents the UI to randomly change the language when reaching
addbooks

The problem is that getlanguage is called BEFORE get_template_and_user,
without, and "interface" (C4::Context->interface) is not set yet.

Open C4/Languages.pm, search "sub getlanguage"
We first read the cache, then if there is no interface we reach
GetTranslatedLanguages that does return languages in a random order,
then we pick the first one
765         @languages = map { $_->{rfc4646_subtag} } @{ getTranslatedLanguages( $interface, $theme ) };
783     $language = shift @languages unless $language;

We must call getlanguage AFTER that the cache is populated.

Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
2026-03-19 10:52:24 +00:00
..
value_builder Bug 40306: Use GET in form of value_builder/unimarc_field_4XX.pl 2026-03-19 10:42:29 +00:00
addbiblio.pl Bug 40272: (QA follow-up) Only add a biblio test 2025-10-16 15:20:20 -06:00
addbooks.pl Bug 41989: Call getlanguage after get_template_and_user 2026-03-19 10:52:24 +00:00
additem.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
cataloging-home.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
concerns.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
editor.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
linkitem.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
merge.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
merge_ajax.pl Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
moveitem.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
plugin_launcher.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
ysearch.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
z3950_auth_search.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
z3950_search.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00