]> git.koha-community.org Git - koha.git/commit
Bug 29826: Manage call of Template Plugin Branches GetName() with null or empty branc...
authorFridolin Somers <fridolin.somers@biblibre.com>
Sat, 8 Jan 2022 01:34:49 +0000 (15:34 -1000)
committerKyle Hall <kyle@bywatersolutions.com>
Fri, 4 Mar 2022 14:59:38 +0000 (09:59 -0500)
commitd673f068ce2b8d79cdcc4e59d560d6b9247539da
treeb40be03371ee6c07b0149af667e3c69fbb2580d6
parente77ca95756919ab1630a35b1c69e0fdc41289f27
Bug 29826: Manage call of Template Plugin Branches GetName() with null or empty branchcode

Bug 26587 added a concatenation that sends a warning if var is undef :
$ prove t/db_dependent/Template/Plugin/Branches.t
Use of uninitialized value $branchcode in concatenation (.) or string at /kohadevbox/koha/Koha/Template/Plugin/Branches.pm line 35.

This patch adds an early return empty string when GetName is called with $branchcode null or empty string.

Test plan :
1) Run t/db_dependent/Template/Plugin/Branches.t without patch
2) Run with the patch to see warning disappear

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Koha/Template/Plugin/Branches.pm
t/db_dependent/Template/Plugin/Branches.t