Summary: | blinddetail-biblio-search uses wrong comparison operator | ||
---|---|---|---|
Product: | Koha | Reporter: | Colin Campbell <colin.campbell> |
Component: | MARC Authority data support | Assignee: | Colin Campbell <colin.campbell> |
Status: | CLOSED FIXED | QA Contact: | Testopia <testopia> |
Severity: | trivial | ||
Priority: | P5 - low | CC: | colin.campbell, tomascohen |
Version: | Main | ||
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: |
Proposed patch
Bug 12573: Use correct comparison for comparing strings [PASSED QA] Bug 12573: Use correct comparison for comparing strings |
Description
Colin Campbell
2014-07-14 15:26:18 UTC
Created attachment 29683 [details] [review] Proposed patch What is the test plan for this? Ways to trigger errors in the log which are eliminated by the patch? Created attachment 32769 [details] [review] 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. Created attachment 32771 [details] [review] [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> Patch pushed to master. Good catch Colin! |