Koha-clms/cataloguing
Jonathan Druart 85ea56a170
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>
(cherry picked from commit da64305067)
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
2026-05-27 12:10:15 +00:00
..
value_builder Bug 8425: Increment the barcode on each call of set_barcode() 2025-04-22 23:02:11 +02:00
addbiblio.pl Bug 39544: New > New record generates warnings in log 2025-08-08 15:41:20 +02:00
addbooks.pl Bug 41989: Call getlanguage after get_template_and_user 2026-05-27 12:10:15 +00:00
additem.pl Bug 25015: (QA follow-up) Slide together 2025-08-08 16:26:27 +02:00
cataloging-home.pl Bug 34288: Allow access to the cataloguing module with `tools` permission 2023-07-18 12:46:53 -03:00
concerns.pl Bug 31028: (follow-up) Fix permissions names 2023-03-06 11:23:17 -03:00
editor.pl Bug 33375: Quote reserved keyword 'rank' in advanced editor 2023-04-14 11:35:26 -03:00
linkitem.pl Bug 34478: Add 'op' to catalogue/MARCdetail 2024-03-01 10:58:28 +01:00
merge.pl Bug 33036: REST API: Merge biblio records implements merging of records 2024-03-18 11:03:39 +01:00
merge_ajax.pl Bug 28785: Adjust check_cookie_auth calls 2021-10-18 11:28:41 +02:00
moveitem.pl Bug 39213: Force scalar on query param barcode 2025-08-08 10:00:06 +02:00
plugin_launcher.pl Bug 24879: Add check_cookie_auth when missing 2024-04-03 17:05:50 +02:00
ysearch.pl Bug 35835: Fix shebang in cataloguing/ysearch.pl 2024-01-26 15:14:03 +01:00
z3950_auth_search.pl Bug 34478: op =~ ^cud- in pl/pm 2024-03-01 10:56:11 +01:00
z3950_search.pl Bug 34478: op =~ ^cud- in pl/pm 2024-03-01 10:56:11 +01:00