Bug 32251: Add a fallback for when language cookie was removed
authorMarcel de Rooy <m.de.rooy@rijksmuseum.nl>
Fri, 18 Nov 2022 07:23:25 +0000 (07:23 +0000)
committerTomas Cohen Arazi <tomascohen@theke.io>
Fri, 27 Jan 2023 19:20:24 +0000 (16:20 -0300)
commita99d188e78d42b7c2b9f2091a64142ba45909c70
tree81bec284a5cf07300773841d2601549e28af4614
parent09874fce6c98f6ec80361da899ba54fac277bd79
Bug 32251: Add a fallback for when language cookie was removed

Since we remove cookies after logout now, the language cookie
might not be there yet. It is friendlier to add the template
language fallback here now too before switching to 'default' in
the Additional contents (AC)-context.

Note: The cookie will not be removed when you added it to the list
in koha-conf.xml.

Note2: This only pertains to the use of opac-page with code param.

Test plan:
[1] Create a CMS page with AC. Add two languages (say en, nl-NL).
    Add different text to default and both languages.
[2] Remove the KohaOPACLanguage cookie from your browser (via
    dev console).
[3] Without this patch, copy the Current language URL from the AC
    overview page. (Note that the Default URL always refers you to
    'default'.)
[4] Go to that page with the selected (Current..) URL. Observe that
    you still see the 'default' text.
[5] Remove the cookie again if it might be there already.
[6] With this patch, observe that you get the language of the
    interface now on the CMS page using the same URL.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Pascal <pascal.uphaus@gwdg.de>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
opac/opac-page.pl