[Bug 8861] New: Undefined variables in batchMod.pl trigger error logs
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8861 Priority: P5 - low Change sponsored?: --- Bug ID: 8861 Assignee: gmcharlt@gmail.com Summary: Undefined variables in batchMod.pl trigger error logs Severity: minor Classification: Unclassified OS: All Reporter: mtompset@hotmail.com Hardware: All Status: NEW Version: master Component: Tools Product: Koha This module was looked at because of: [Tue Oct 02 17:00:56 2012] [error] [client 192.168.100.2] [Tue Oct 2 17:00:56 2012] batchMod.pl: Problem = a value of 1 has been passed to param without key at /usr/share/koha/lib/C4/Templates.pm line 187. There are two sections that match, though this was likely the $op case, not the $error case: $template->param( op => $nextop, $op => 1, ); foreach my $error (@errors) { $template->param($error => 1); } I would normally change: my $op = $input->param('op'); into my $op = $input->param('op') || q{}; However there was code that read: if (!defined $op) { So, I looked to see how $op was used after that: if ($op eq "action") { if ($op eq "show"){ Of course, the above error'ing code, and lastly. if ($op eq "action") { As such, I decided to define $op = q{} inside the if statement, after it ran it's !defined check. And I still moved the $op => 1 to an external, conditional template param call. Additionally, I looked for where @errors was used in the file, but only the declaration, and this foreach had a @errors reference. And as an array could be filled with undef's, I err'd on the side of caution by adding "if $error" on the template parameter call. This was found in 3.8.5. Looks like it is master too. Patch to follow shortly. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8861 M. Tompsett <mtompset@hotmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff Assignee|gmcharlt@gmail.com |mtompset@hotmail.com --- Comment #1 from M. Tompsett <mtompset@hotmail.com> --- Created attachment 12635 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=12635&action=edit Fix inconsequential error loggling in batchMod.pl Test ==== 1) Login to staff client 2) Tools 3) Batch item modification 4) check intranet error logs. Should see error like: [Tue Oct 02 21:13:19 2012] [error] [client 192.168.100.2] [Tue Oct 2 21:13:19 2012] batchMod.pl: Problem = a value of 1 has been passed to param without key at /usr/share/koha/lib/C4/Templates.pm line 187., 5) apply patch 6) Tools 7) Batch item modification 8) check intranet error logs. Error should not be created. This the master version patch. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8861 --- Comment #2 from M. Tompsett <mtompset@hotmail.com> --- Created attachment 12636 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=12636&action=edit Fix inconsequential error loggling in batchMod.pl (3.8, 3.6) Should be the same tests as above. This patch should apply to 3.8.x and 3.6.x versions. This was tested in 3.8.5. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8861 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #12635|0 |1 is obsolete| | --- Comment #3 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 12708 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=12708&action=edit [SIGNED-OFF] Bug 8861 - Undefined variables in batchMod.pl trigger error logs Initialized $op, and changed lines like "$op => 1" and "$error => 1" into separate, conditional template param calls. 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=8861 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #12636|0 |1 is obsolete| | --- Comment #4 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 12709 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=12709&action=edit [SIGNED-OFF] Bug 8861 - Undefined variables in batchMod.pl trigger error logs (3.8, 3.6) Initialized $op, and changed lines like "$op => 1" and "$error => 1" into separate, conditional template param calls. 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=8861 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off CC| |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=8861 Jonathan Druart <jonathan.druart@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA CC| |jonathan.druart@biblibre.co | |m --- Comment #5 from Jonathan Druart <jonathan.druart@biblibre.com> --- Looks good, marked as Passed QA. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8861 Jonathan Druart <jonathan.druart@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- QA Contact| |jonathan.druart@biblibre.co | |m -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8861 Paul Poulain <paul.poulain@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to Master CC| |paul.poulain@biblibre.com Version|master |rel_3_10 --- Comment #6 from Paul Poulain <paul.poulain@biblibre.com> --- Patch 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=8861 Chris Cormack <chris@bigballofwax.co.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to Master |Pushed to Stable CC| |chris@bigballofwax.co.nz --- Comment #7 from Chris Cormack <chris@bigballofwax.co.nz> --- Pushed to 3.8.x will be in 3.8.12 -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org