[Bug 6840] New: error in Template.pm in logs
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=6840 Bug #: 6840 Summary: error in Template.pm in logs Classification: Unclassified Change sponsored?: --- Product: Koha Version: rel_3_6 Platform: All OS/Version: All Status: NEW Severity: minor Priority: P5 Component: Architecture, internals, and plumbing AssignedTo: gmcharlt@gmail.com ReportedBy: paul.poulain@biblibre.com QAContact: koha-bugs@lists.koha-community.org In staff interface, in search (catalogue/search.pl), there is a warning saying: [Fri Sep 2 18:20:24 2011] search.pl: Use of uninitialized value $key in hash element at /home/paul/koha.dev/koha-community/C4/Templates.pm line 227. The problem happens when searching from the quick search toolbar, not when you search from advanced search. Investigating, it seems it's because the sort_by is not defined in this case. Patch will follow -- Configure bugmail: http://bugs.koha-community.org/bugzilla3/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the QA Contact for the bug.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=6840 Paul Poulain <paul.poulain@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Priority|P5 |PATCH-Sent Patch Status|--- |Needs Signoff Change sponsored?|--- |Sponsored AssignedTo|gmcharlt@gmail.com |paul.poulain@biblibre.com -- Configure bugmail: http://bugs.koha-community.org/bugzilla3/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the QA Contact for the bug.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=6840 --- Comment #1 from Paul Poulain <paul.poulain@biblibre.com> 2011-09-02 16:40:27 UTC --- Created attachment 5298 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=5298 proposed patch proposed patch -- Configure bugmail: http://bugs.koha-community.org/bugzilla3/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the QA Contact for the bug.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=6840 Owen Leonard <oleonard@myacpl.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #5298|0 |1 is obsolete| | --- Comment #2 from Owen Leonard <oleonard@myacpl.org> 2011-09-30 18:41:13 UTC --- Created attachment 5671 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=5671 Signed-off patch Before: Error appears in the log each time a search is done from the header search form. After: No error appears. -- Configure bugmail: http://bugs.koha-community.org/bugzilla3/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the QA Contact for the bug.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=6840 Owen Leonard <oleonard@myacpl.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |ASSIGNED Patch Status|Needs Signoff |Signed Off -- Configure bugmail: http://bugs.koha-community.org/bugzilla3/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the QA Contact for the bug.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=6840 Ian Walls <ian.walls@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |ian.walls@bywatersolutions. | |com Patch Status|Signed Off |Passed QA --- Comment #3 from Ian Walls <ian.walls@bywatersolutions.com> 2011-10-12 21:25:09 UTC --- Easy patch to read, well-documented. Adds conditional checks and clearer error messages. Marking as Passed QA -- Configure bugmail: http://bugs.koha-community.org/bugzilla3/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the QA Contact for the bug.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=6840 Chris Cormack <chris@bigballofwax.co.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |chris@bigballofwax.co.nz Patch Status|Passed QA |Patch Pushed --- Comment #4 from Chris Cormack <chris@bigballofwax.co.nz> 2011-10-13 03:18:34 UTC --- No template changes, pushed please test -- Configure bugmail: http://bugs.koha-community.org/bugzilla3/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the QA Contact for the bug.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=6840 Fred P <fred.pierre@smfpl.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |fred.pierre@smfpl.org --- Comment #5 from Fred P <fred.pierre@smfpl.org> 2011-12-13 16:52:38 UTC --- We were receiving the same error while searching patrons from the patron quick search. The patch is helpful, but still generates tons of log messages, so we altered the moremember.pl around line 474 to omit the "$error => 1," editing the error parameter as follows: --------------------------------------------------- overdues_exist => $overdues_exist, error => 0, StaffMember => ($category_type eq 'S'), --------------------------------------------------- then we added this to the moremember.pl at line 485: --------------------------------------------------- #addition to test error parameter status if ( $error ) { $template -> param ( $error => 1, error => 1, ); } ----------------------------------------- -- Configure bugmail: http://bugs.koha-community.org/bugzilla3/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the QA Contact for the bug. You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=6840 Jared Camins-Esakov <jcamins@cpbibliography.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to Master |ASSIGNED --- Comment #6 from Jared Camins-Esakov <jcamins@cpbibliography.com> --- It sounds like there are still problems, so resetting status to ASSIGNED. Please close if I have misunderstood the comments. -- You are receiving this mail because: You are the QA Contact for the bug. You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=6840 M. Tompsett <mtompset@hotmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |mtompset@hotmail.com --- Comment #7 from M. Tompsett <mtompset@hotmail.com> --- This patch is fine, in my opinion. The comment made by Fred P 2011-12-13 16:52:38 UTC is a different problem, in my reading. I proposed a solution to his bug in bug 7630 (see also bug 7352). The problem is not all modules call with the 'error' parameter set. And Fred P's suggestion of: #addition to test error parameter status if ( $error ) { $template -> param ( $error => 1, error => 1, ); } is overkill compared to simply splitting up the large $template->param() call, and having $template->param($error => 1) if $error; separately from the long list. No, I didn't do any testing. I just don't want a good patch wasted. :) -- You are receiving this mail because: You are the QA Contact for the bug. You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=6840 --- Comment #8 from Chris Cormack <chris@bigballofwax.co.nz> --- (In reply to comment #7)
This patch is fine, in my opinion. The comment made by Fred P 2011-12-13 16:52:38 UTC is a different problem, in my reading. I proposed a solution to his bug in bug 7630 (see also bug 7352).
The problem is not all modules call with the 'error' parameter set. And Fred P's suggestion of: #addition to test error parameter status if ( $error ) { $template -> param ( $error => 1, error => 1, ); } is overkill compared to simply splitting up the large $template->param() call, and having $template->param($error => 1) if $error; separately from the long list.
No, I didn't do any testing. I just don't want a good patch wasted. :)
Well setting $error=>1 is different because the value of $error isn't 'error' so you would have to change the template as well. To match that in your patch you arent setting error in the template -- You are receiving this mail because: You are the QA Contact for the bug. You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=6840 --- Comment #9 from M. Tompsett <mtompset@hotmail.com> --- (In reply to comment #8)
(In reply to comment #7) ...
Fred P's suggestion of: #addition to test error parameter status if ( $error ) { $template -> param ( $error => 1, error => 1, ); } is overkill compared to simply splitting up the large $template->param() call, and having $template->param($error => 1) if $error; separately from the long list.
No, I didn't do any testing. I just don't want a good patch wasted. :)
Well setting $error=>1 is different because the value of $error isn't 'error' so you would have to change the template as well. To match that in your patch you arent setting error in the template
True it should be:
$error => 1, error => $error,
I was merely quoting from comment #5
Otherwise, it would potentially break: upload-images.tt edithelp.tt addbooks.tt paycollect.tt step2.tt (the web installer!) step3.tt (yes, the web installer!) sms-home.tt But, it would probably still work in: linkitem.tt moveitem.tt senshelfform.tt moremember.tt label-manage.tt clone-rules.tt sendbasketform.tt opac-sendbasketform.tt opac-sendshelfform.tt On a git repo of master, I did a: $ vi `grep -l "IF ( error )" \`find . -name '*.tt'\`` This obviously may miss the plain [% error %]. So I did a: $ vi `grep -l "% error %" \`find . -name '*.tt'\`` And it returned 6 of the 7 files I listed as potentially broken. And as I said before, Fred P.'s suggestion to fix what bug he did find is better served by taking the '$error => 1' out of the larger $template->param() section and putting: $template->param($error => 1) if $error; just after that large section. The bug described by Fred P. is likely the same as the one discussed in bug 7352 and bug 7630. In fact, I decided to do a: $ grep "\$error\s*=>\s1" `find .` I found: ./tools/batchMod.pl ./cataloguing/additem.pl ./members/moremember.pl ./members/member-password.pl ./members/memberentry.pl If $error is undefined, all these modules will have problems. I did not look further, as that is beyond the scope of this error and the two bug reports I have mentioned. The patch viewable by diff is perfectly sufficient for the bug described in this bug report. However, as I said before Fred P.'s suggestion is better addressed by bug 7352 and bug 7630 being fixed as suggested above. A warning, which this patch generates, is better than the error generated by not having it. Clearly this patch is functioning, because it seems to be in 3.6.3 which we are currently running, and I found the other errors as a result of this cleanly generated "error" (really a warning), rather than an ugly error. In short, I think the status should be closed, so focus on bug 7352 and bug 7630 can be dealt with, which is what I believe Fred P. encountered. -- You are receiving this mail because: You are the QA Contact for the bug. You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=6840 --- Comment #10 from M. Tompsett <mtompset@hotmail.com> --- I have posted a patch on bug 7630 which should address Fred P's issues. This patch is still live. I like it. It's a friendly warning, rather than an error to track down. Thanks to jcamins for helping me get my DEV setup done. :) Can someone close this bug? It's not an issue, in my opinion. -- You are receiving this mail because: You are the QA Contact for the bug. You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=6840 Jared Camins-Esakov <jcamins@cpbibliography.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |RESOLVED Resolution|--- |FIXED --- Comment #11 from Jared Camins-Esakov <jcamins@cpbibliography.com> --- At Mark's request I have looked into it a bit more, and can confirm that this bug has been fixed. Closing. -- You are receiving this mail because: You are the QA Contact for the bug. You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org