[Bug 14153] New: Noisy warns in admin/transport-cost-matrix.pl
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14153 Bug ID: 14153 Summary: Noisy warns in admin/transport-cost-matrix.pl Change sponsored?: --- Product: Koha Version: unspecified Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: System Administration Assignee: koha-bugs@lists.koha-community.org Reporter: aleishaamohia@hotmail.com QA Contact: testopia@bugs.koha-community.org CC: gmcharlt@gmail.com my $update = $input->param('op') eq 'set-cost-matrix'; The above code (line 45) causes a warn 'Use of unintialized value in string eq' -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14153 Aleisha Amohia <aleishaamohia@hotmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14153 --- Comment #1 from Aleisha Amohia <aleishaamohia@hotmail.com> --- Created attachment 38880 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=38880&action=edit Bug 14153: Noisy warns in admin/transport-cost-matrix.pl This patch silences the warn by putting curly braces around the $input->param('op') code, to kind of group this as a variable. I don't know that this is the best solution for this but the warn is no longer there. To test: 1) Go to Admin -> Transport cost matrix 2) Notice the warns in the error log 3) Apply the patch and refresh page 4) Notice page still works but no warns in error log -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14153 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |katrin.fischer@bsz-bw.de Assignee|koha-bugs@lists.koha-commun |aleishaamohia@hotmail.com |ity.org | -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14153 Zeno Tajoli <z.tajoli@cineca.it> changed: What |Removed |Added ---------------------------------------------------------------------------- Patch complexity|--- |Trivial patch -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14153 --- Comment #2 from Galen Charlton <gmcharlt@gmail.com> --- Comment on attachment 38880 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=38880 Bug 14153: Noisy warns in admin/transport-cost-matrix.pl Review of attachment 38880: --> (http://bugs.koha-community.org/bugzilla3/page.cgi?id=splinter.html&bug=14153&attachment=38880) ----------------------------------------------------------------- ::: admin/transport-cost-matrix.pl @@ +42,4 @@
}); my $use_transport_cost_matrix = C4::Context->preference("UseTransportCostMatrix");
+my $update = {$input->param('op')} eq 'set-cost-matrix';
Adding the curly brace here means that the code is trying to create an anonymous hash containing the contents of $input->param('op'), and that can't be compared to the scalar value 'set-cost-matrix'. Also, when trying to update an entry in the table, an "Odd number of elements in anonymous hash" error is thrown. Something like this would do the trick: my $update = ( $input->param('op') // '' ) eq 'set-cost-matrix'; -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14153 Galen Charlton <gmcharlt@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Failed QA -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14153 Aleisha Amohia <aleishaamohia@hotmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14153 --- Comment #3 from Aleisha Amohia <aleishaamohia@hotmail.com> --- Created attachment 45628 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=45628&action=edit Bug 14153: Galen Charlton's fix to warns Changing line 45 to my $update = ( $input->param('op') // '' ) eq 'set-cost-matrix'; To test: 1) Go to Admin -> Transport cost matrix 2) Notice the warns in the error log 3) Apply the patch and refresh page 4) Notice page still works but no warns in error log -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14153 Aleisha Amohia <aleishaamohia@hotmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #38880|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14153 Jonathan Druart <jonathan.druart@bugs.koha-community.org> 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=14153 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #45628|0 |1 is obsolete| | --- Comment #4 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 46011 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=46011&action=edit Bug 14153: Noisy warns in admin/transport-cost-matrix.pl To test: 1) Go to Admin -> Transport cost matrix 2) Notice the warns in the error log 3) Apply the patch and refresh page 4) Notice page still works but no warns in error log Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Amended patch: Init a $op variable, if it must be reused later. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14153 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jonathan.druart@bugs.koha-c | |ommunity.org Severity|enhancement |minor Status|Signed Off |Passed QA --- Comment #5 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Trivial, skipping QA. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14153 Brendan Gallagher <brendan@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to Master -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14153 Brendan Gallagher <brendan@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #46011|0 |1 is obsolete| | --- Comment #6 from Brendan Gallagher <brendan@bywatersolutions.com> --- Created attachment 46065 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=46065&action=edit Bug 14153: Noisy warns in admin/transport-cost-matrix.pl To test: 1) Go to Admin -> Transport cost matrix 2) Notice the warns in the error log 3) Apply the patch and refresh page 4) Notice page still works but no warns in error log Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Amended patch: Init a $op variable, if it must be reused later. Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14153 Brendan Gallagher <brendan@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |brendan@bywatersolutions.co | |m --- Comment #7 from Brendan Gallagher <brendan@bywatersolutions.com> --- Pushed to Master - thanks -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14153 --- Comment #8 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- (In reply to Brendan Gallagher from comment #6)
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Amended patch: Init a $op variable, if it must be reused later.
Note that I have not made this change finally. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14153 Julian Maurice <julian.maurice@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |julian.maurice@biblibre.com Status|Pushed to Master |Pushed to Stable --- Comment #9 from Julian Maurice <julian.maurice@biblibre.com> --- Patch pushed to 3.22.x, will be in 3.22.2 -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14153 Frédéric Demians <frederic@tamil.fr> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |frederic@tamil.fr --- Comment #10 from Frédéric Demians <frederic@tamil.fr> --- This patch has been pushed to 3.20.x, will be in 3.20.8. -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org