Bug 7874 - Templates::get_language generates lots of not defined warnings
Summary: Templates::get_language generates lots of not defined warnings
Alias: None
Product: Koha
Classification: Unclassified
Component: Architecture, internals, and plumbing (show other bugs)
Version: 3.6
Hardware: All All
: P5 - low minor (vote)
Assignee: Colin Campbell
QA Contact: Ian Walls
Depends on:
Reported: 2012-04-02 14:30 UTC by Colin Campbell
Modified: 2013-12-05 20:04 UTC (History)
2 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:

Proposed patch (2.36 KB, patch)
2012-04-02 14:44 UTC, Colin Campbell
Details | Diff | Splinter Review
Signed-off patch (2.62 KB, patch)
2012-04-03 14:18 UTC, Frédéric Demians
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Colin Campbell 2012-04-02 14:30:33 UTC
Was trying to track another error and found the get_languages routine in C4::Templates was giving lots of not defined errors in the logs. Looking closer found that the routine has obviously grown by accretion and was a) not always too clear in its intention b) was carelessly using undefined values c) was actually passing undef to other routines so they could in turn log warnings and return undef - only a few cycles wasted but it is a routine that could be called freqently. 
Have refactored the routine to address these concerns
Comment 1 Colin Campbell 2012-04-02 14:44:19 UTC Comment hidden (obsolete)
Comment 2 Frédéric Demians 2012-04-03 14:18:56 UTC
Created attachment 8811 [details] [review]
Signed-off patch

Having put my hands recently in this part of Koha code, I can confirm
that this patch fix log warnings, and add clarity and conciseness.
Comment 3 Paul Poulain 2012-04-04 16:35:00 UTC
QA comment: small patches, nothing to spot. passed QA

I've tested language change still works after applying the patch by switching from en to fr-FR and then back to en
Comment 4 Jared Camins-Esakov 2012-05-24 00:51:24 UTC
This patch will be included in 3.6.5.