From: Bill Erickson Date: Mon, 16 Jul 2018 14:56:52 +0000 (-0400) Subject: LP#1779158 Vandelay queue filters query repair X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=977c66badc95883b92308c4776de244602301e54;p=working%2FEvergreen.git LP#1779158 Vandelay queue filters query repair Fixes an issue with the queued record filters where filtering on import errors lead to an invalid query, returning zero results. Modify code to retain the import-errors portion of the from clause. Signed-off-by: Bill Erickson --- diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Vandelay.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Vandelay.pm index 84c5055448..a25a59f65b 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Vandelay.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Vandelay.pm @@ -532,17 +532,25 @@ sub retrieve_queued_records { } elsif( $$options{with_item_import_error} and $type eq 'bib') { - $query->{from} = {$class => 'vii'}; + $query->{from} = {$class => {'vii' => {}}}; $query->{where}->{'+vii'} = {import_error => {'!=' => undef}}; } } if($self->api_name =~ /matches/) { # find only records that have matches - $query->{from} = {$class => {$mclass => {type => 'right'}}}; + if (ref $query->{from}) { + $query->{from}{$class}{$mclass} = {type => 'right'}; + } else { + $query->{from} = {$class => {$mclass => {type => 'right'}}}; + } } else { # join to mclass for sorting (see below) - $query->{from} = {$class => {$mclass => {type => 'left'}}}; + if (ref $query->{from}) { + $query->{from}{$class}{$mclass} = {type => 'left'}; + } else { + $query->{from} = {$class => {$mclass => {type => 'left'}}}; + } } # order by the matched bib records to group like queued records