[open-ils-commits] [GIT] Evergreen ILS branch master updated. ea20f3920b2ef71e12ef40afdeb40a6f5f361186

Evergreen Git git at git.evergreen-ils.org
Fri May 20 10:20:34 EDT 2011


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Evergreen ILS".

The branch, master has been updated
       via  ea20f3920b2ef71e12ef40afdeb40a6f5f361186 (commit)
      from  eb7b98bafb4f107f4f3190882b6a375ebacfbd40 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit ea20f3920b2ef71e12ef40afdeb40a6f5f361186
Author: Lebbeous Fogle-Weekley <lebbeous at esilibrary.com>
Date:   Fri May 20 10:17:05 2011 -0400

    Fix a problem with open-ils.circ.holds.retrieve_all_from_title
    
    Anoop Atre spotted this bug that's triggered by selecting "View Holds"
    from "Actions for Selected Record" in the catalog seen through the staff
    client.
    
    Said method would error out like this:
    
    [2011-05-20 10:04:03] open-ils.circ [ERR
    :31866:CStoreEditor.pm:109:13058333633194115] editor[0|1] request error
    open-ils.cstore.direct.serial.issuance.id_list.atomic :
    {"subscription":[]} : Exception:
    OpenSRF::DomainObject::oilsMethodException 2011-05-20T10:04:03
    OpenILS::Utils::CStoreEditor
    /openils/lib/perl5/OpenILS/Utils/CStoreEditor.pm:412 <500>  Severe query
    error -- see error log for more details
    
    because when trying to gather issuance-type holds, it didn't properly test
    whether there actually were any subscriptions and issuances related to
    the bib record in question.
    
    Signed-off-by: Lebbeous Fogle-Weekley <lebbeous at esilibrary.com>

diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Holds.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Holds.pm
index 03f947f..734936f 100644
--- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Holds.pm
+++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Holds.pm
@@ -2750,7 +2750,7 @@ sub all_rec_holds {
     $args->{fulfillment_time} = undef; #  we don't want to see old fulfilled holds
 	$args->{cancel_time} = undef;
 
-	my $resp = { volume_holds => [], copy_holds => [], metarecord_holds => [] };
+	my $resp = { volume_holds => [], copy_holds => [], metarecord_holds => [], issuance_holds => [] };
 
     my $mr_map = $e->search_metabib_metarecord_source_map({source => $title_id})->[0];
     if($mr_map) {
@@ -2778,15 +2778,22 @@ sub all_rec_holds {
 
     my $subs = $e->search_serial_subscription(
         { record_entry => $title_id }, {idlist=>1});
-    my $issuances = $e->search_serial_issuance(
-        { subscription => $subs }, {idlist=>1});
 
-    $resp->{issuance_holds} = $e->search_action_hold_request(
-        {
-			hold_type => OILS_HOLD_TYPE_ISSUANCE,
-            target => $issuances,
-            %$args
-        }, {idlist=>1} );
+    if (@$subs) {
+        my $issuances = $e->search_serial_issuance(
+            {subscription => $subs}, {idlist=>1}
+        );
+
+        if ($issuances) {
+            $resp->{issuance_holds} = $e->search_action_hold_request(
+                {
+                    hold_type => OILS_HOLD_TYPE_ISSUANCE,
+                    target => $issuances,
+                    %$args
+                }, {idlist=>1}
+            );
+        }
+    }
 
 	my $vols = $e->search_asset_call_number(
 		{ record => $title_id, deleted => 'f' }, {idlist=>1});

-----------------------------------------------------------------------

Summary of changes:
 .../perlmods/lib/OpenILS/Application/Circ/Holds.pm |   25 ++++++++++++-------
 1 files changed, 16 insertions(+), 9 deletions(-)


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list