From: Mike Rylander Date: Wed, 2 Sep 2015 20:45:42 +0000 (-0400) Subject: webstaff: Avoid adding deleted notes that were created in the same session X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=3530113c1acfde66e45a3f67ba65ca43de52c2a4;p=evergreen%2Ftadl.git webstaff: Avoid adding deleted notes that were created in the same session Signed-off-by: Mike Rylander Signed-off-by: Galen Charlton Signed-off-by: Jason Stephenson --- diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Cat/AssetCommon.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Cat/AssetCommon.pm index 8d642b3ee2..fe0913c7fd 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Cat/AssetCommon.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Cat/AssetCommon.pm @@ -236,6 +236,8 @@ sub update_copy_notes { next unless $incoming_note; if ($incoming_note->isnew) { + next if ($incoming_note->isdeleted); # if it was added and deleted in the same session + my $new_note = Fieldmapper::asset::copy_note->new(); $new_note->owning_copy( $copy->id ); $new_note->pub( $incoming_note->pub ); @@ -244,6 +246,7 @@ sub update_copy_notes { $new_note->creator( $incoming_note->creator || $editor->requestor->id ); $incoming_note = $editor->create_asset_copy_note($new_note) or return $editor->event; + } elsif ($incoming_note->ischanged) { $incoming_note = $editor->update_asset_copy_note($incoming_note) } elsif ($incoming_note->isdeleted) {