From: Galen Charlton Date: Tue, 17 May 2011 04:40:02 +0000 (-0400) Subject: stop hold permit check from crashing if age protection in effect X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=7f1c97593d5a58558fda6347f9bd4b021a3100d9;p=Evergreen.git stop hold permit check from crashing if age protection in effect Signed-off-by: Galen Charlton --- diff --git a/Open-ILS/src/sql/Pg/110.hold_matrix.sql b/Open-ILS/src/sql/Pg/110.hold_matrix.sql index 41054727e0..602bcdb761 100644 --- a/Open-ILS/src/sql/Pg/110.hold_matrix.sql +++ b/Open-ILS/src/sql/Pg/110.hold_matrix.sql @@ -174,6 +174,7 @@ DECLARE transit_range_ou_type actor.org_unit_type%ROWTYPE; transit_source actor.org_unit%ROWTYPE; item_object asset.copy%ROWTYPE; + item_cn_object asset.call_number%ROWTYPE; result action.matrix_test_result; hold_test config.hold_matrix_matchpoint%ROWTYPE; hold_count INT; @@ -308,6 +309,7 @@ BEGIN IF item_object.create_date + age_protect_object.age > NOW() THEN IF hold_test.distance_is_from_owner THEN + SELECT INTO item_cn_object * FROM asset.call_number WHERE id = item_object.call_number; SELECT INTO hold_transit_prox prox FROM actor.org_unit_proximity WHERE from_org = item_cn_object.owning_lib AND to_org = pickup_ou; ELSE SELECT INTO hold_transit_prox prox FROM actor.org_unit_proximity WHERE from_org = item_object.circ_lib AND to_org = pickup_ou;