Bug 12654

Summary: Incorrect quoting in regexp in AuthoritiesMarc
Product: Koha Reporter: Colin Campbell <colin.campbell>
Component: MARC Authority data supportAssignee: Colin Campbell <colin.campbell>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: minor    
Priority: P5 - low CC: jcamins, tomascohen
Version: Main   
Hardware: All   
OS: All   
GIT URL: Change sponsored?: ---
Patch complexity: Small patch Documentation contact:
Documentation submission: Text to go in the release notes:
Version(s) released in:
Circulation function:
Attachments: Proposed patch
Bug 12654 Correct incorrectly quoted regexp
[PASSED QA] Bug 12654 Correct incorrectly quoted regexp

Description Colin Campbell 2014-07-24 16:01:51 UTC
An incorrect quote of a metacharacter in a regexp in AuthoritiesMarc.pm causes a compile time warning : Useless use of '\'; doesn't escape metacharacter '(' at /home/cc/kohaclone/C4/AuthoritiesMarc.pm line 856.    
    

annoyingly this crops up every time the module is compiled (e.g. in runs of rebuildzebra Let's quote correctly and silence the message
Comment 1 Colin Campbell 2014-07-24 16:21:06 UTC Comment hidden (obsolete)
Comment 2 Chris Cormack 2014-07-29 07:01:53 UTC Comment hidden (obsolete)
Comment 3 Katrin Fischer 2014-07-29 21:24:25 UTC
Created attachment 30312 [details] [review]
[PASSED QA] Bug 12654 Correct incorrectly quoted regexp

A compile time warning was being generated because \ does not quote
{ Replace the plethora of \ before meta and presumed meta characters
by \Q \E which gets perl to generate all the necessary escapes, we can
assume it knows its regex engine as well or better than the human
programmer

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Verified change reading the perldoc and also checked that
./misc/link_bibs_to_authorities.pl is no longer showing
the warn and still works.
Comment 4 Tomás Cohen Arazi (tcohen) 2014-07-30 14:15:22 UTC
Patch pushed to master.

Thanks Colin!
Comment 5 Jonathan Druart 2015-04-28 10:08:27 UTC
*** Bug 12364 has been marked as a duplicate of this bug. ***