Allow nested modifiers
authorJared Camins-Esakov <jcamins@cpbibliography.com>
Sat, 8 Sep 2012 03:36:36 +0000 (23:36 -0400)
committerLebbeous Fogle-Weekley <lebbeous@esilibrary.com>
Fri, 15 Feb 2013 20:39:45 +0000 (15:39 -0500)
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Signed-off-by: Thomas Berezansky <tsbere@mvlc.org>
Signed-off-by: Lebbeous Fogle-Weekley <lebbeous@esilibrary.com>
Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/QueryParser.pm

index 0b756de..6f948ef 100644 (file)
@@ -650,7 +650,7 @@ sub decompose {
             warn "Encountered search modifier: $1\n" if $self->debug;
 
             $_ = $';
-            if (!$struct->top_plan) {
+            if (!($struct->top_plan || $parser_config{QueryParser}->{allow_nested_modifiers})) {
                 warn "  Search modifiers only allowed at the top level of the query\n" if $self->debug;
             } else {
                 $struct->new_modifier($1);
@@ -663,7 +663,7 @@ sub decompose {
             my $mod = $1;
 
             $_ = $';
-            if (!$struct->top_plan) {
+            if (!($struct->top_plan || $parser_config{QueryParser}->{allow_nested_modifiers})) {
                 warn "  Search modifiers only allowed at the top level of the query\n" if $self->debug;
             } elsif ($2 =~ /^[ty1]/i) {
                 $struct->new_modifier($mod);