Retrieving org settings with an org unit object as the context org unit
results in errors and dying.
This affects legacy scripts only.
Signed-off-by: Bill Erickson <berick@esilibrary.com>
Signed-off-by: Michael Peters <mrpeters@library.in.gov>
{ order_by => 'age' }
);
+ # circ_lib may be fleshed
+ my $context_org = ref $copy->circ_lib ? $copy->circ_lib->id : $copy->circ_lib;
my $age_protect_date = $copy->create_date;
- $age_protect_date = $copy->active_date if($U->ou_ancestor_setting_value($copy->circ_lib, 'circ.holds.age_protect.active_date'));
+ $age_protect_date = $copy->active_date if($U->ou_ancestor_setting_value($context_org, 'circ.holds.age_protect.active_date'));
my $age = 0;
my $age_protect_parsed;