Koha-clms/cataloguing
Jonathan Druart da64305067
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: Laura Escamilla <laura.escamilla@bywatersolutions.com>
2026-05-23 15:58:40 -04:00
..
value_builder Bug 29733: MARC21: Link 7xx linking fields to marc21_linking_section.pl value builder 2026-02-17 17:46:27 +00:00
addbiblio.pl Bug 40272: (QA follow-up) Only add a biblio test 2026-02-17 16:31:33 +00:00
addbooks.pl Bug 41989: Call getlanguage after get_template_and_user 2026-05-23 15:58:40 -04:00
additem.pl Bug 40163: Fix several http addresses in the code docs 2026-01-07 14:32:30 +00:00
cataloging-home.pl Bug 40163: Fix several http addresses in the code docs 2026-01-07 14:32:30 +00:00
concerns.pl Bug 40163: Fix several http addresses in the code docs 2026-01-07 14:32:30 +00:00
editor.pl Bug 40163: Fix several http addresses in the code docs 2026-01-07 14:32:30 +00:00
linkitem.pl Bug 40163: Fix several http addresses in the code docs 2026-01-07 14:32:30 +00:00
merge.pl Bug 40163: Fix several http addresses in the code docs 2026-01-07 14:32:30 +00: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 2026-01-07 14:32:30 +00:00
plugin_launcher.pl Bug 40163: Fix several http addresses in the code docs 2026-01-07 14:32:30 +00:00
ysearch.pl Bug 40163: Fix several http addresses in the code docs 2026-01-07 14:32:30 +00:00
z3950_auth_search.pl Bug 40163: Fix several http addresses in the code docs 2026-01-07 14:32:30 +00:00
z3950_search.pl Bug 40163: Fix several http addresses in the code docs 2026-01-07 14:32:30 +00:00