for (grep { $_ ne '-and' } keys %{$$filter{event}});
}
- my $e = new_editor();
+ my $e = new_editor(xact=>1);
my $events = $e->json_query($query);
my $client = shift;
my $granularity = shift;
- my $editor = new_editor();
-
my $query = [{ state => 'pending', run_time => {'<' => 'now'} }, { order_by => { atev => [ qw/run_time add_time/] }, 'join' => 'atevdef' }];
if (defined $granularity) {
$query->[0]->{'+atevdef'} = {granularity => undef};
}
- return $editor->search_action_trigger_event(
+ return new_editor(xact=>1)->search_action_trigger_event(
$query, { idlist=> 1, timeout => 7200, substream => 1 }
);
}
return $self if (!$self->id);
+ if ($self->standalone) {
+ $self->editor->xact_begin || return undef;
+ }
+
$self->event(
$self->editor->retrieve_action_trigger_event([
$self->id, {
])
);
+ if ($self->standalone) {
+ $self->editor->xact_rollback || return undef;
+ }
+
$self->user_data(OpenSRF::Utils::JSON->JSON2perl( $self->event->user_data ))
if (defined( $self->event->user_data ));
$meth =~ s/Fieldmapper:://;
$meth =~ s/::/_/;
+ if ($self->standalone) {
+ $self->editor->xact_begin || return undef;
+ }
+
$self->target( $self->editor->$meth( $self->event->target ) );
+ if ($self->standalone) {
+ $self->editor->xact_rollback || return undef;
+ }
+
return $self;
}
my $ed = grep( /open-ils.cstore/, @{$fclass->Controller} ) ?
$self->editor :
- new_rstore_editor();
+ new_rstore_editor(($self->standalone ? () : (xact=>1)));
my $obj = $context->$step();
);
if (!ref $obj) {
+
+ if ($self->standalone) {
+ $ed->xact_begin || return undef;
+ }
+
$obj = $ed->$meth(
($multi) ?
{ $ffield => $context->$lfield() } :
$context->$lfield()
);
+
+ if ($self->standalone) {
+ $ed->xact_rollback || return undef;
+ }
+
}
if (@$path) {
# returns the calculated copy price
get_copy_price => sub {
my $copy_id = shift;
- return $U->get_copy_price(new_editor(), $copy_id);
+ return $U->get_copy_price(new_editor(xact=>1), $copy_id);
},
# given a copy, returns the title and author in a hash
get_copy_bib_basics => sub {
my $copy_id = shift;
- my $copy = new_editor()->retrieve_asset_copy([
+ my $copy = new_editor(xact=>1)->retrieve_asset_copy([
$copy_id,
{
flesh => 2,