From: miker Date: Fri, 24 Sep 2010 17:56:31 +0000 (+0000) Subject: put the frozen (and also empty issuance or last-copy-removed) check back in as a... X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=fc6bbab434b11d374cfce86fb464a962dcb613e4;p=contrib%2FConifer.git put the frozen (and also empty issuance or last-copy-removed) check back in as a conditional select if we found nothing mapped git-svn-id: svn://svn.open-ils.org/ILS/trunk@17957 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- diff --git a/Open-ILS/src/perlmods/OpenILS/Application/Circ/Holds.pm b/Open-ILS/src/perlmods/OpenILS/Application/Circ/Holds.pm index 01819699d1..030aa11b3c 100644 --- a/Open-ILS/src/perlmods/OpenILS/Application/Circ/Holds.pm +++ b/Open-ILS/src/perlmods/OpenILS/Application/Circ/Holds.pm @@ -1060,6 +1060,28 @@ sub retrieve_hold_queue_status_impl { } }); + if (!@$q_holds) { # none? maybe we don't have a map ... + my $q_holds = $e->json_query({ + select => {ahr => ['id', 'cut_in_line', 'request_time']}, + from => 'ahr', + order_by => [ + { + "class" => "ahr", + "field" => "cut_in_line", + "transform" => "coalesce", + "params" => [ 0 ], + "direction" => "desc" + }, + { "class" => "ahr", "field" => "request_time" } + ], + where => { + hold_type => $hold->hold_type, + target => $hold->target + } + }); + } + + my $qpos = 1; for my $h (@$q_holds) { last if $h->{id} == $hold->id;