From e2f6cca04f506e0500cbddb80806c87f12b91edb Mon Sep 17 00:00:00 2001 From: Mike Rylander Date: Wed, 2 Sep 2015 16:43:16 -0400 Subject: [PATCH] webstaff: Copy note bug fixing Signed-off-by: Mike Rylander Signed-off-by: Galen Charlton Signed-off-by: Jason Stephenson --- .../lib/OpenILS/Application/Cat/AssetCommon.pm | 18 +++++++++++++----- .../src/templates/staff/cat/volcopy/t_copy_notes.tt2 | 2 +- 2 files changed, 14 insertions(+), 6 deletions(-) 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 7b0ea444b7..8d642b3ee2 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Cat/AssetCommon.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Cat/AssetCommon.pm @@ -228,7 +228,6 @@ sub update_copy_notes { my($class, $editor, $copy) = @_; return undef if $copy->isdeleted; - return undef unless $copy->ischanged or $copy->isnew; my $evt; my $incoming_notes = $copy->notes; @@ -245,9 +244,9 @@ 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; - } elif ($incoming_note->ischanged) { + } elsif ($incoming_note->ischanged) { $incoming_note = $editor->update_asset_copy_note($incoming_note) - } elif ($incoming_note->isdeleted) { + } elsif ($incoming_note->isdeleted) { $incoming_note = $editor->delete_asset_copy_note($incoming_note->id) } @@ -360,11 +359,17 @@ sub update_fleshed_copies { $copy->location( $copy->location->id ) if ref($copy->location); $copy->circ_lib( $copy->circ_lib->id ) if ref($copy->circ_lib); + my $parts = $copy->parts; + $copy->clear_parts; + my $sc_entries = $copy->stat_cat_entries; $copy->clear_stat_cat_entries; - my $parts = $copy->parts; - $copy->clear_parts; + my $sc_entries = $copy->stat_cat_entries; + $copy->clear_stat_cat_entries; + + my $notes = $copy->notes; + $copy->clear_notes; if( $copy->isdeleted ) { $evt = $class->delete_copy($editor, $override, $vol, $copy, $retarget_holds, $force_delete_empty_bib); @@ -382,9 +387,12 @@ sub update_fleshed_copies { $copy->stat_cat_entries( $sc_entries ); $evt = $class->update_copy_stat_entries($editor, $copy, $delete_stats); + $copy->parts( $parts ); # probably okay to use $delete_stats here for simplicity $evt = $class->update_copy_parts($editor, $copy, $delete_stats, $create_parts); + + $copy->notes( $notes ); $evt = $class->update_copy_notes($editor, $copy); return $evt if $evt; } diff --git a/Open-ILS/src/templates/staff/cat/volcopy/t_copy_notes.tt2 b/Open-ILS/src/templates/staff/cat/volcopy/t_copy_notes.tt2 index 7bd26a70b1..8b875f04b5 100644 --- a/Open-ILS/src/templates/staff/cat/volcopy/t_copy_notes.tt2 +++ b/Open-ILS/src/templates/staff/cat/volcopy/t_copy_notes.tt2 @@ -52,7 +52,7 @@ -
+
-- 2.11.0