From: berick Date: Mon, 2 May 2011 19:49:33 +0000 (-0400) Subject: added 'with_import_error' option to queued record retrieval; returns recs with eithe... X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=0aec475a117564063a98a4e0219b35946eb393db;p=evergreen%2Fpines.git added 'with_import_error' option to queued record retrieval; returns recs with either a record or item import failure (or both) --- diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Vandelay.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Vandelay.pm index 7f34422851..4df6c1d329 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Vandelay.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Vandelay.pm @@ -430,19 +430,25 @@ sub retrieve_queued_records { }; $query->{where}->{import_time} = undef if $$options{non_imported}; - $query->{where}->{import_error} = {'!=' => undef} if $$options{with_rec_import_error}; - - if($$options{with_item_import_error} and $type eq 'bib') { - # limit to recs that have at least 1 item import error - $query->{from} = { - $class => { - vii => { - field => 'record', - fkey => 'id', - filter => {import_error => {'!=' => undef}} - } - } - }; + + if($$options{with_import_error}) { + + $query->{from} = {$class => {vii => {type => 'right'}}}; + $query->{where}->{'-or'} = [ + {'+vqbr' => {import_error => {'!=' => undef}}}, + {'+vii' => {import_error => {'!=' => undef}}} + ]; + + } else { + + if($$options{with_rec_import_error}) { + $query->{where}->{import_error} = {'!=' => undef}; + + } elsif( $$options{with_item_import_error} and $type eq 'bib') { + + $query->{from} = {$class => 'vii'}; + $query->{where}->{'+vii'} = {import_error => {'!=' => undef}}; + } } if($self->api_name =~ /matches/) {