[Bug 29826] New: Remove warning in t/db_dependent/Template/Plugin/Branches.t
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29826 Bug ID: 29826 Summary: Remove warning in t/db_dependent/Template/Plugin/Branches.t Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: minor Priority: P5 - low Component: Test Suite Assignee: chris@bigballofwax.co.nz Reporter: fridolin.somers@biblibre.com QA Contact: testopia@bugs.koha-community.org 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. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29826 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|chris@bigballofwax.co.nz |fridolin.somers@biblibre.co | |m Status|NEW |ASSIGNED Depends on| |26587 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26587 [Bug 26587] Cache libraries in Branches TT plugin to improve performance -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29826 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|Remove warning in |Useless warning in |t/db_dependent/Template/Plu |t/db_dependent/Template/Plu |gin/Branches.t |gin/Branches.t -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29826 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |Needs Signoff Patch complexity|--- |Trivial patch -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29826 --- Comment #1 from Fridolin Somers <fridolin.somers@biblibre.com> --- Created attachment 129208 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=129208&action=edit Bug 29826: Remove warning in t/db_dependent/Template/Plugin/Branches.t 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 without $branchcode Test plan : 1) Run t/db_dependent/Template/Plugin/Branches.t without patch 2) Run with the patch to see warning disappear -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29826 Bug 29826 depends on bug 26587, which changed state. Bug 26587 Summary: Cache libraries in Branches TT plugin to improve performance https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26587 What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to stable |RESOLVED Resolution|--- |FIXED -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29826 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29826 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #129208|0 |1 is obsolete| | --- Comment #2 from David Nind <david@davidnind.com> --- Created attachment 129630 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=129630&action=edit Bug 29826: Remove warning in t/db_dependent/Template/Plugin/Branches.t 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 without $branchcode 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> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29826 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jonathan.druart+koha@gmail. | |com --- Comment #3 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- I don't know if this is correct. We should never call the plugin without parameter. In my opinion the test is wrong and should be removed. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29826 --- Comment #4 from Fridolin Somers <fridolin.somers@biblibre.com> --- (In reply to Jonathan Druart from comment #3)
I don't know if this is correct. We should never call the plugin without parameter. In my opinion the test is wrong and should be removed.
This may occur with suggestions that can have branch undefined. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29826 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |m.de.rooy@rijksmuseum.nl --- Comment #5 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- This report refers to the test. So the suggestion thing might be a different case. Or widen the scope by changing the title? + return q{} unless defined $branchcode; This still has the effect of testing if there is a branch with an empty code. Which makes no sense either? So you could also return unless $branchcode. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29826 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|Useless warning in |Manage call of Template |t/db_dependent/Template/Plu |Plugin Branches with null |gin/Branches.t |or empty branchcode --- Comment #6 from Fridolin Somers <fridolin.somers@biblibre.com> --- (In reply to Marcel de Rooy from comment #5)
This report refers to the test. So the suggestion thing might be a different case. Or widen the scope by changing the title? Ah good point, I change title.
+ return q{} unless defined $branchcode; This still has the effect of testing if there is a branch with an empty code. Which makes no sense either? So you could also return unless $branchcode.
Ah indeed. But we must allow branchcode=0. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29826 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |ASSIGNED -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29826 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|Manage call of Template |Manage call of Template |Plugin Branches with null |Plugin Branches GetName() |or empty branchcode |with null or empty | |branchcode -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29826 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29826 --- Comment #7 from Fridolin Somers <fridolin.somers@biblibre.com> --- Created attachment 130030 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=130030&action=edit 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 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29826 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |david@davidnind.com Attachment #129630|0 |1 is obsolete| | --- Comment #8 from David Nind <david@davidnind.com> --- Comment on attachment 129630 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=129630 Bug 29826: Remove warning in t/db_dependent/Template/Plugin/Branches.t Replaced by later patch -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29826 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29826 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #130030|0 |1 is obsolete| | --- Comment #9 from David Nind <david@davidnind.com> --- Created attachment 130201 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=130201&action=edit 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> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29826 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #130201|0 |1 is obsolete| | --- Comment #10 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 131183 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=131183&action=edit 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> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29826 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |martin.renvoize@ptfs-europe | |.com Status|Signed Off |Passed QA --- Comment #11 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Great fix, includes tests, no regressions and squelched warnings. Passing QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29826 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)| |22.05.00 released in| | Status|Passed QA |Pushed to master -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29826 --- Comment #12 from Fridolin Somers <fridolin.somers@biblibre.com> --- Pushed to master for 22.05, thanks to everybody involved 🦄 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29826 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |kyle@bywatersolutions.com Status|Pushed to master |Pushed to stable Version(s)|22.05.00 |22.05.00,21.11.04 released in| | --- Comment #13 from Kyle M Hall <kyle@bywatersolutions.com> --- Pushed to 21.11.x for 21.11.04 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29826 Andrew Fuerste-Henry <andrew@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |andrew@bywatersolutions.com Status|Pushed to stable |RESOLVED Resolution|--- |FIXED --- Comment #14 from Andrew Fuerste-Henry <andrew@bywatersolutions.com> --- Missing dependency, not backported to 21.05 -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org