Bug 20094 - gather_print_notices.pl uses first language in opaclanguages syspref but first cannot be configured
Summary: gather_print_notices.pl uses first language in opaclanguages syspref but firs...
Status: RESOLVED DUPLICATE of bug 20115
Alias: None
Product: Koha
Classification: Unclassified
Component: Architecture, internals, and plumbing (show other bugs)
Version: master
Hardware: All All
: P5 - low normal (vote)
Target Milestone: ---
Assignee: Jonathan Druart
QA Contact: Testopia
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-01-26 18:20 UTC by Nick Clemens
Modified: 2018-01-31 18:17 UTC (History)
3 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Bot Control: ---
When did the bot last check this:
Who signed the patch off:
Text to go in the release notes:
Version(s) released in:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Nick Clemens 2018-01-26 18:20:19 UTC
We saw this problem on a site with multiple opaclanguages selected, all notices were defaulting to arabic template and printed as RTL.

The cronjob gets the template which calls C4::Languages::getlanguage()

The interface is read as 'opac' and no language is selected (no cookie, etc.)

We eventually grab the first from the pref (bug 10560)

The languages in the pref are loaded randomly into the admin view, try searching for 'opaclanguages' a few times or refreshing page, the order is random.

Uncheck and recheck a language and save, note the pref is filled in the display order

Run gather_print_notices.pl with different languages as first in the pref, note that a different template is used for each.

I think the solution is just to allow for passing a specified language to the cron.
Comment 1 Katrin Fischer 2018-01-30 07:12:18 UTC
Hm, should it not use the setting from the patron record? And as a fallback the language added to the default section of notices?
Comment 2 Nick Clemens 2018-01-30 10:44:36 UTC
Default isn't defined anywhere though, it just means to use the notices marked as default, and we don't have that for print notices. We could also add a syspref for 'DefaultLanguage', or just a checkbox when  selecting languages to specify one as the default and force that to be saved first in the pref
Comment 3 Katrin Fischer 2018-01-30 12:23:21 UTC
Hm, will take another look at the GUI tonight - we don't have the version yet with multi-lang notices.
Comment 4 Jonathan Druart 2018-01-31 18:17:41 UTC
I think bug 20115 will answer your need, could you confirm?

*** This bug has been marked as a duplicate of bug 20115 ***