Bug 41711 - The function Koha::Notice::Templates::find_effective_template selects a (probably) incorrect notice template
Summary: The function Koha::Notice::Templates::find_effective_template selects a (prob...
Status: NEW
Alias: None
Product: Koha
Classification: Unclassified
Component: Notices (show other bugs)
Version: unspecified
Hardware: All All
: P5 - low normal
Assignee: Bugs List
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2026-01-26 11:21 UTC by Janusz Kaczmarek
Modified: 2026-01-26 11:21 UTC (History)
0 users

See Also:
GIT URL:
Initiative type: ---
Sponsorship status: ---
Comma delimited list of Sponsors:
Crowdfunding goal: 0
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Janusz Kaczmarek 2026-01-26 11:21:35 UTC
When notice templates of a given type are defined for a specific library, but not in all languages, we would likely expect Koha to select the template of that type for the given library in the default language, rather than a generic template in the requested language.

For example, if we are looking for:

{ branch: 'BRANCH', lang: 'es-ES', code: 'CHECKOUT' }

and such a template does not exist, we would prefer:

{ branch: 'BRANCH', lang: 'default', code: 'CHECKOUT' }

over:

{ branch: '', lang: 'es-ES', code: 'CHECKOUT' }.

However, Koha currently prioritizes language matching over library matching and therefore returns the template:

{ branch: '', lang: 'es-ES', code: 'CHECKOUT' }.