diff --git a/lib/Tuba/Book.pm b/lib/Tuba/Book.pm index 356b0157..e079b86d 100644 --- a/lib/Tuba/Book.pm +++ b/lib/Tuba/Book.pm @@ -69,7 +69,7 @@ sub update { $map->save(audit_user => $c->audit_user, audit_note => $c->audit_note) or return $c->update_error($map->error); } } - $book->delete; + $book->delete(audit_user => $c->audit_user, audit_note => $c->audit_note); return $c->redirect_to( $report->uri($c, { tab => 'show' } ) ); } $c->SUPER::update(@_); diff --git a/lib/Tuba/Instrument.pm b/lib/Tuba/Instrument.pm index 7e7f11fc..81dfa7e7 100644 --- a/lib/Tuba/Instrument.pm +++ b/lib/Tuba/Instrument.pm @@ -61,7 +61,7 @@ sub update_rel { platform_identifier => $platform_id, instrument_identifier => $instrument->identifier)->load( speculative => 1) or return $c->redirect_without_error("Could not find $platform_id"); - $map->delete or return $c->update_error($map->error); + $map->delete(audit_user => $c->audit_user, audit_note => $c->audit_note) or return $c->update_error($map->error); $c->flash(info => "Deleted $platform_id"); } return $c->SUPER::update_rel(@_); diff --git a/lib/Tuba/Lexicon.pm b/lib/Tuba/Lexicon.pm index 1b663934..6c018622 100644 --- a/lib/Tuba/Lexicon.pm +++ b/lib/Tuba/Lexicon.pm @@ -54,7 +54,7 @@ sub update_rel { logger->info("deleting $lexicon $context $term"); my $ex = Exterm->new(lexicon => $lexicon, term => $term, context => $context); $ex->load(speculative => 1) or next; - $ex->delete or return $c->update_error($ex->error); + $ex->delete(audit_user => $c->audit_user, audit_note => $c->audit_note) or return $c->update_error($ex->error); } } return $c->redirect_without_error('update_rel_form'); diff --git a/lib/Tuba/Organization.pm b/lib/Tuba/Organization.pm index 40dd6631..3f23bc0f 100644 --- a/lib/Tuba/Organization.pm +++ b/lib/Tuba/Organization.pm @@ -96,7 +96,7 @@ sub update_rel { organization_relationship_identifier => $type ); $map->load(speculative => 1) or return $c->update_error("relationship not found"); - $map->delete(audit_user => $c->audit_user) or return $c->update_error($map->error); + $map->delete(audit_user => $c->audit_user), audit_note => $c->audit_note or return $c->update_error($map->error); $c->stash(info => "Saved changes."); } @@ -181,7 +181,7 @@ sub merge { { organization_identifier => $other->identifier}, { organization_identifier => $org->identifier }) or die $dbs->errstr; - $org->delete(audit_user => $c->audit_user); + $org->delete(audit_user => $c->audit_user, audit_note => $c->audit_note); $dbs->commit or die $dbs->error; }; if ($@) { return $c->update_error($@) } diff --git a/lib/Tuba/Platform.pm b/lib/Tuba/Platform.pm index 80719456..49d51e41 100644 --- a/lib/Tuba/Platform.pm +++ b/lib/Tuba/Platform.pm @@ -72,7 +72,7 @@ sub update_rel { if (my $del = $json->{del}) { $del->{platform_identifier} = $platform->identifier; my $obj = InstrumentInstance->new( %$del ); - $obj->delete; + $obj->delete(audit_user => $c->audit_user, audit_note => $c->audit_note); } } if (my $instrument_id = $c->param('delete_map_instruments')) { @@ -80,7 +80,7 @@ sub update_rel { platform_identifier => $platform->identifier, instrument_identifier => $instrument_id)->load( speculative => 1) or return $c->redirect_without_error("Could not find $instrument_id"); - $map->delete or return $c->update_error($map->error); + $map->delete(audit_user => $c->audit_user, audit_note => $c->audit_note) or return $c->update_error($map->error); $c->flash(info => "Deleted $instrument_id"); } $c->SUPER::update_rel(@_); diff --git a/lib/Tuba/Reference.pm b/lib/Tuba/Reference.pm index cc8c2393..4bf30a16 100644 --- a/lib/Tuba/Reference.pm +++ b/lib/Tuba/Reference.pm @@ -157,7 +157,7 @@ sub post_update { my $s = PublicationReferenceMap->new(reference_identifier => $reference->identifier, publication_id => $pub_id); next unless $s->publication->publication_type_identifier eq $cat; $s->load(speculative => 1) or next; - $s->delete or do { $reference->error($s->error); return 0; }; + $s->delete(audit_user => $c->audit_user, audit_note => $c->audit_note) or do { $reference->error($s->error); return 0; }; } return 1; } @@ -258,7 +258,7 @@ sub update_rel { }; my $sub = PublicationReferenceMap->new(reference_identifier => $reference->identifier, publication_id => $pub->id); $sub->load(speculative => 1) or return $c->redirect_with_error(update_rel_form => "$pub not found"); - $sub->delete or return $c->reply->exception($sub->error); + $sub->delete(audit_user => $c->audit_user, audit_note => $c->audit_note) or return $c->reply->exception($sub->error); } return $c->render(json => { status => 'ok'}); @@ -295,7 +295,7 @@ sub update_rel { if (my $which = $c->param('delete_publication')) { my $sub = PublicationReferenceMap->new(reference_identifier => $reference->identifier, publication_id => $which); $sub->load(speculative => 1) or return $c->redirect_with_error(update_rel_form => "$sub not found"); - $sub->delete(audit_user => $c->audit_user) or return $c->redirect_with_error(update_rel_form => $sub->error); + $sub->delete(audit_user => $c->audit_user, audit_note => $c->audit_note) or return $c->redirect_with_error(update_rel_form => $sub->error); $c->stash(message => "saved changes"); } $c->redirect_without_error('update_rel_form'); diff --git a/lib/Tuba/Table.pm b/lib/Tuba/Table.pm index 00e4e37f..7d9a9cec 100644 --- a/lib/Tuba/Table.pm +++ b/lib/Tuba/Table.pm @@ -142,7 +142,7 @@ sub update_rel { my $array = Array->new(identifier => $id); $array->load; if (!@{ $array->tables }) { - $array->delete; + $array->delete(audit_user => $c->audit_user, audit_note => $c->audit_note); $c->flash(message => 'Deleted array'); } else { $c->flash(message => 'Deleted array for this table');