use OpenILS::Application::AppUtils;
use OpenILS::Application::Actor;
use OpenSRF::Utils::Logger qw/$logger/;
+use Scalar::Util;
my $U = "OpenILS::Application::AppUtils";
use Data::Dumper;
my @ORG_LIST;
+
# -----------------------------------------------------------------------
# Possible Args:
# copy
my $runner = OpenILS::Utils::ScriptRunner->new;
- $runner->insert( "$evt.groupTree", $GROUP_TREE, 1);
+ my $gt = $GROUP_TREE;
+ weaken($gt); # just to be safe
+ $runner->insert( "$evt.groupTree", $gt, 1);
$runner->insert( "$evt.patron", $ctx->{patron}, 1);
flatten_org_tree($ORG_TREE);
}
+ my $r = $runner;
+ weaken($r);
+
$runner->insert(__OILS_FUNC_isOrgDescendent =>
sub {
my( $write_key, $sname, $id ) = @_;
my ($parent) = grep { $_->shortname eq $sname } @ORG_LIST;
my ($child) = grep { $_->id == $id } @ORG_LIST;
my $val = is_org_descendent( $parent, $child );
- $runner->insert($write_key, $val);
+ $r->insert($write_key, $val);
return $val;
}
);
# params within a hash are: copy, patron,
# requestor, request_lib, title, title_descriptor
sub permit_copy_hold {
-
my $params = shift;
- my $k = 'environment';
my $runner = OpenILS::Application::Circ::ScriptBuilder->build(
{
load_scripts($runner);
my $result = $runner->run or throw OpenSRF::EX::ERROR ("Hold Copy Permit Script Died: $@");
+ $runner->context->destroy;
+
# --------------------------------------------------------------
# Extract and uniquify the event list
# --------------------------------------------------------------