bug 5693 - mc-ccode parens fix
authorReed Wade <reed@catalyst.net.nz>
Fri, 4 Mar 2011 04:13:00 +0000 (23:13 -0500)
committerChris Nighswonger <chris.nighswonger@gmail.com>
Sun, 6 Mar 2011 00:38:00 +0000 (19:38 -0500)
Signed-off-by: Nicole C. Engard <nengard@bywatersolutions.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
(cherry picked from commit c84dad3b187770160a845d77f146870cc0159c63)

Signed-off-by: Chris Nighswonger <chris.nighswonger@gmail.com>
C4/Search.pm

index e647b9d..dd76f4f 100644 (file)
@@ -1274,7 +1274,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";