From 5751c25a5491b61786dd8a420a8aca09690873b6 Mon Sep 17 00:00:00 2001 From: Reed Wade Date: Fri, 4 Feb 2011 16:17:03 +1300 Subject: [PATCH] bug 5693 - mc-ccode parens fix Content-Type: text/plain; charset="utf-8" To: koha-patches@lists.koha-community.org --- C4/Search.pm | 9 ++++++++- 1 files changed, 8 insertions(+), 1 deletions(-) diff --git a/C4/Search.pm b/C4/Search.pm index a469948..27f5679 100644 --- a/C4/Search.pm +++ b/C4/Search.pm @@ -1270,7 +1270,14 @@ sub buildQuery { # group_OR_limits, prefixed by mc- # OR every member of the group elsif ( $this_limit =~ /mc/ ) { -# if ( $this_limit =~ /mc/ ) { + + if ( $this_limit =~ /mc-ccode:/ ) { + # in case the mc-ccode value has complicating chars like ()'s inside it we wrap in quotes + $this_limit =~ tr/"//d; + my ($k,$v) = split(/:/, $this_limit,2); + $this_limit = $k.":\"".$v."\""; + } + $group_OR_limits .= " or " if $group_OR_limits; $limit_desc .= " or " if $group_OR_limits; $group_OR_limits .= "$this_limit"; -- 1.7.1