[Bug 12573] New: blinddetail-biblio-search uses wrong comparidon operator
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12573 Bug ID: 12573 Summary: blinddetail-biblio-search uses wrong comparidon operator Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: MARC Authority data support Assignee: gmcharlt@gmail.com Reporter: colin.campbell@ptfs-europe.com QA Contact: testopia@bugs.koha-community.org The following message appears in the apache errorlog: blinddetail-biblio-search.pl: Argument "\x{61}" isn't numeric in numeric eq (==) at /home/koha/kohaclone/authorities/blinddetail-biblio-search.pl line 89. The program is comparing two strings with a numeric compare which can result in subtle bugs and error messages like the above even when working as expected -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12573 Colin Campbell <colin.campbell@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff CC| |colin.campbell@ptfs-europe. | |com Assignee|gmcharlt@gmail.com |colin.campbell@ptfs-europe. | |com --- Comment #1 from Colin Campbell <colin.campbell@ptfs-europe.com> --- Created attachment 29683 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=29683&action=edit Proposed patch -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12573 Colin Campbell <colin.campbell@ptfs-europe.com> 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=12573 --- Comment #2 from Owen Leonard <oleonard@myacpl.org> --- What is the test plan for this? Ways to trigger errors in the log which are eliminated by the patch? -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12573 Frédéric Demians <frederic@tamil.fr> 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=12573 Frédéric Demians <frederic@tamil.fr> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #29683|0 |1 is obsolete| | --- Comment #3 from Frédéric Demians <frederic@tamil.fr> --- Created attachment 32769 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=32769&action=edit Bug 12573: Use correct comparison for comparing strings Perl issues a warning when you try to do a numeric comparison on non numeric values. While in 99% of the caeses numeric and string comparison behave similarly when they dont tracking down resulting bugs is hard. Also we dont want to be logging errors for normal operations. replace numeric == with eq (also switched to non-interpolating quotes so we dont generate a warning from static code checkers like perlcritic) Signed-off-by: Frederic Demians <f.demians@tamil.fr> I can get this warnings in log files. This patch make perfectly sense. MARC subfield code should never be tested with Perl == operator, since the code could be letter or a number. Perl eq operator do an implicit string conversion for value which is a number, so it will work in any case. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12573 Katrin Fischer <katrin.fischer@bsz-bw.de> 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=12573 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #32769|0 |1 is obsolete| | --- Comment #4 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Created attachment 32771 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=32771&action=edit [PASSED QA] Bug 12573: Use correct comparison for comparing strings Perl issues a warning when you try to do a numeric comparison on non numeric values. While in 99% of the caeses numeric and string comparison behave similarly when they dont tracking down resulting bugs is hard. Also we dont want to be logging errors for normal operations. replace numeric == with eq (also switched to non-interpolating quotes so we dont generate a warning from static code checkers like perlcritic) Signed-off-by: Frederic Demians <f.demians@tamil.fr> I can get this warnings in log files. This patch make perfectly sense. MARC subfield code should never be tested with Perl == operator, since the code could be letter or a number. Perl eq operator do an implicit string conversion for value which is a number, so it will work in any case. Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12573 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to Master CC| |tomascohen@gmail.com --- Comment #5 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Patch pushed to master. Good catch Colin! -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12573 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |katrin.fischer@bsz-bw.de Summary|blinddetail-biblio-search |blinddetail-biblio-search |uses wrong comparidon |uses wrong comparison |operator |operator -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12573 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Severity|enhancement |trivial -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org