Summary: | Noisy warns in admin/transport-cost-matrix.pl | ||
---|---|---|---|
Product: | Koha | Reporter: | Aleisha Amohia <aleisha> |
Component: | System Administration | Assignee: | Aleisha Amohia <aleisha> |
Status: | CLOSED FIXED | QA Contact: | Testopia <testopia> |
Severity: | minor | ||
Priority: | P5 - low | CC: | brendan, f.demians, gmcharlt, jonathan.druart, julian.maurice |
Version: | unspecified | ||
Hardware: | All | ||
OS: | All | ||
Change sponsored?: | --- | Patch complexity: | Trivial patch |
Documentation contact: | Documentation submission: | ||
Text to go in the release notes: | Version(s) released in: | ||
Circulation function: | |||
Attachments: |
Bug 14153: Noisy warns in admin/transport-cost-matrix.pl
Bug 14153: Galen Charlton's fix to warns Bug 14153: Noisy warns in admin/transport-cost-matrix.pl Bug 14153: Noisy warns in admin/transport-cost-matrix.pl |
Description
Aleisha Amohia
2015-05-06 04:46:31 UTC
Created attachment 38880 [details] [review] 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 Comment on attachment 38880 [details] [review] Bug 14153: Noisy warns in admin/transport-cost-matrix.pl Review of attachment 38880 [details] [review]: ----------------------------------------------------------------- ::: 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'; Created attachment 45628 [details] [review] 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 Created attachment 46011 [details] [review] 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. Trivial, skipping QA. Created attachment 46065 [details] [review] 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> Pushed to Master - thanks (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. Patch pushed to 3.22.x, will be in 3.22.2 This patch has been pushed to 3.20.x, will be in 3.20.8. |