Deflesh copy->call_number in NCIP::ILS::Evergreen->delete_copy.
authorJason Stephenson <jason@sigio.com>
Sat, 13 Sep 2014 18:49:43 +0000 (14:49 -0400)
committerJason Stephenson <jason@sigio.com>
Sat, 13 Sep 2014 18:49:43 +0000 (14:49 -0400)
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 <jason@sigio.com>
lib/NCIP/ILS/Evergreen.pm

index 0e2a174..a2f8005 100644 (file)
@@ -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');