[Bug 11732] New: Eliminate warning on undefined branchcode
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11732 Bug ID: 11732 Summary: Eliminate warning on undefined branchcode Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: trivial Priority: P5 - low Component: Notices Assignee: koha-bugs@lists.koha-community.org Reporter: m.de.rooy@rijksmuseum.nl QA Contact: testopia@bugs.koha-community.org When you run the Reserves test, you have the warnings: Use of uninitialized value $branchcode in hash element at /usr/share/koha/testclone/C4/Letters.pm line 138. Use of uninitialized value $branchcode in hash element at /usr/share/koha/testclone/C4/Letters.pm line 148. This patch removes that warning. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11732 M. de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11732 --- Comment #1 from M. de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 25171 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=25171&action=edit Bug 11732: Eliminate warning on undefined branchcode When you run the Reserves test, you have the warnings: Use of uninitialized value $branchcode in hash element at /usr/share/koha/testclone/C4/Letters.pm line 138. Use of uninitialized value $branchcode in hash element at /usr/share/koha/testclone/C4/Letters.pm line 148. This patch removes that warning. Test plan: Run the Reserves.t again. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11732 M. de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Patch complexity|--- |Trivial patch Assignee|koha-bugs@lists.koha-commun |m.de.rooy@rijksmuseum.nl |ity.org | -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11732 M. Tompsett <mtompset@hotmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |mtompset@hotmail.com --- Comment #2 from M. Tompsett <mtompset@hotmail.com> --- I tried to test this, but test 7 fails when I run: prove -v t/db_dependent/Reserves.t And an error message is not triggered even in master. I suspect I don't have things set to pretend to be logged in. This eyeballs just fine, but I was wondering... why not move line 129 to after the if? And why not // instead of ||? Sorry, I couldn't trigger this. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11732 M. de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #25171|0 |1 is obsolete| | --- Comment #3 from M. de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 25208 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=25208&action=edit Bug 11732: Eliminate warning on undefined branchcode When you run the Reserves test, you have the warnings: Use of uninitialized value $branchcode in hash element at /usr/share/koha/testclone/C4/Letters.pm line 138. Use of uninitialized value $branchcode in hash element at /usr/share/koha/testclone/C4/Letters.pm line 148. This patch removes that warning. Test plan: Run the Reserves.t again. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11732 --- Comment #4 from M. de Rooy <m.de.rooy@rijksmuseum.nl> --- (In reply to M. Tompsett from comment #2)
I tried to test this, but test 7 fails when I run: prove -v t/db_dependent/Reserves.t And an error message is not triggered even in master. I suspect I don't have things set to pretend to be logged in. The test creates branches and categories, even sets a pref, so this apparently requires more digging into other circulation settings.. It is interesting to know why it fails (with the AddReturn call, I understand), but this report just fixes a trivial uninitialized value.
This eyeballs just fine, but I was wondering... why not move line 129 to after the if? And why not // instead of ||? Fine with me. New patch submitted.
-- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11732 --- Comment #5 from M. Tompsett <mtompset@hotmail.com> --- I still can't trigger it with t/db_dependent/Reserves.t However, I did trigger your patch with: perl -e "use C4::Letters; my \$blah=C4::Letters::getletter('circulation','DUE');" This got me thinking. Shouldn't I be able to trigger this with: prove -v t/Letters.t OR prove -v t/db_dependent/Letters.t ? At which point I discovered some rather ugly failings. Could you be explicit to the point of annoyance to confirm that I am trying to test it the same way, and have the same settings, and have similar data which triggers the error in master? -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11732 --- Comment #6 from M. de Rooy <m.de.rooy@rijksmuseum.nl> --- (In reply to M. Tompsett from comment #5)
Could you be explicit to the point of annoyance to confirm that I am trying to test it the same way, and have the same settings, and have similar data which triggers the error in master?
No annoyance as long as you keep testing :) t/db_dependent/Letters.t does indeed produce some ugly errors with me too. Does not call getletter. t/Letters.t does not call getletter; so will not trigger the patch too. The call ..$var=getletter(..).. will imo not trigger the patch; userenv will return false. Note that Reserves.t also overrides userenv on line 23. We could do the same: perl -e "use C4::Letters; *C4::Context::userenv= sub { return {} }; my $blah=C4::Letters::getletter('circulation','DUE', 'BRA');" Without the patch, you have a warning. With the patch, you will have not. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11732 M. Tompsett <mtompset@hotmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11732 M. Tompsett <mtompset@hotmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #25208|0 |1 is obsolete| | --- Comment #7 from M. Tompsett <mtompset@hotmail.com> --- Created attachment 25230 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=25230&action=edit [SIGNED OFF] Bug 11732: Eliminate warning on undefined branchcode When you run the Reserves test, you have the warnings: Use of uninitialized value $branchcode in hash element at /usr/share/koha/testclone/C4/Letters.pm line 138. Use of uninitialized value $branchcode in hash element at /usr/share/koha/testclone/C4/Letters.pm line 148. This patch removes that warning. Test plan: Run the Reserves.t again. Revised Test Plan ----------------- Run the following on the command line prompt before and after applying the patch: perl -e "use C4::Letters; *C4::Context::userenv= sub { return {} }; my \$blah=C4::Letters::getletter('circulation','DUE', 'BRA');" Before the patch there will be errors (as above), after there will not. Signed-off-by: Mark Tompsett <mtompset@hotmail.com> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11732 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11732 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #25230|0 |1 is obsolete| | --- Comment #8 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 25274 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=25274&action=edit Bug 11732: Eliminate warning on undefined branchcode When you run the Reserves test, you have the warnings: Use of uninitialized value $branchcode in hash element at /usr/share/koha/testclone/C4/Letters.pm line 138. Use of uninitialized value $branchcode in hash element at /usr/share/koha/testclone/C4/Letters.pm line 148. This patch removes that warning. Test plan: Run the Reserves.t again. Revised Test Plan ----------------- Run the following on the command line prompt before and after applying the patch: perl -e "use C4::Letters; *C4::Context::userenv= sub { return {} }; my \$blah=C4::Letters::getletter('circulation','DUE', 'BRA');" Before the patch there will be errors (as above), after there will not. Signed-off-by: Mark Tompsett <mtompset@hotmail.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11732 Jonathan Druart <jonathan.druart@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #25274|0 |1 is obsolete| | --- Comment #9 from Jonathan Druart <jonathan.druart@biblibre.com> --- Created attachment 25275 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=25275&action=edit Bug 11732: Eliminate warning on undefined branchcode When you run the Reserves test, you have the warnings: Use of uninitialized value $branchcode in hash element at /usr/share/koha/testclone/C4/Letters.pm line 138. Use of uninitialized value $branchcode in hash element at /usr/share/koha/testclone/C4/Letters.pm line 148. This patch removes that warning. Test plan: Run the Reserves.t again. Revised Test Plan ----------------- Run the following on the command line prompt before and after applying the patch: perl -e "use C4::Letters; *C4::Context::userenv= sub { return {} }; my \$blah=C4::Letters::getletter('circulation','DUE', 'BRA');" Before the patch there will be errors (as above), after there will not. Signed-off-by: Mark Tompsett <mtompset@hotmail.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com> IndependentBranches must be on. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11732 Galen Charlton <gmcharlt@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to Master CC| |gmcharlt@gmail.com --- Comment #10 from Galen Charlton <gmcharlt@gmail.com> --- Pushed to master. Thanks, Marcel! -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11732 Fridolin SOMERS <fridolyn.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to Master |Pushed to Stable CC| |fridolyn.somers@biblibre.co | |m --- Comment #11 from Fridolin SOMERS <fridolyn.somers@biblibre.com> --- Pushed to 3.14.x, will be in 3.14.07 -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org