Allow nested modifiers
authorJared Camins-Esakov <jcamins@cpbibliography.com>
Sat, 8 Sep 2012 03:36:36 +0000 (23:36 -0400)
committerJared Camins-Esakov <jcamins@cpbibliography.com>
Sun, 9 Sep 2012 19:16:10 +0000 (15:16 -0400)
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/QueryParser.pm

index c5c8ece..abc06ad 100644 (file)
@@ -613,7 +613,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);
@@ -626,7 +626,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);