From 5049b94a6780c444427c4dd4040e1a6746cf720e Mon Sep 17 00:00:00 2001 From: Jason Stephenson Date: Sat, 13 Sep 2014 14:49:43 -0400 Subject: [PATCH 1/1] Deflesh copy->call_number in NCIP::ILS::Evergreen->delete_copy. To keep things simple, we deflesh the call number of the copy to be deleted, if it was fleshed earlier, which it was likely to be. Signed-off-by: Jason Stephenson --- lib/NCIP/ILS/Evergreen.pm | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/NCIP/ILS/Evergreen.pm b/lib/NCIP/ILS/Evergreen.pm index 0e2a174..a2f8005 100644 --- a/lib/NCIP/ILS/Evergreen.pm +++ b/lib/NCIP/ILS/Evergreen.pm @@ -1297,6 +1297,12 @@ sub delete_copy { # First, make sure the copy is not already deleted and we own it. return undef if ($U->is_true($copy->deleted()) || $copy->circ_lib() != $ou_id); + # If call_number was fleshed, deflesh it. + if (ref($copy->call_number())) { + my $cn = $copy->call_number(); + $copy->call_number($cn->id()); + } + # We need a transaction & connected session. my $xact; my $session = OpenSRF::AppSession->create('open-ils.pcrud'); -- 2.43.2