[open-ils-commits] r13061 - branches/rel_1_4/Open-ILS/src/support-scripts (erickson)

svn at svn.open-ils.org svn at svn.open-ils.org
Mon May 4 17:10:24 EDT 2009


Author: erickson
Date: 2009-05-04 17:10:20 -0400 (Mon, 04 May 2009)
New Revision: 13061

Modified:
   branches/rel_1_4/Open-ILS/src/support-scripts/generate_circ_notices.pl
Log:
add some protection against partially cataloged pre-cat copies

Modified: branches/rel_1_4/Open-ILS/src/support-scripts/generate_circ_notices.pl
===================================================================
--- branches/rel_1_4/Open-ILS/src/support-scripts/generate_circ_notices.pl	2009-05-04 20:10:14 UTC (rev 13060)
+++ branches/rel_1_4/Open-ILS/src/support-scripts/generate_circ_notices.pl	2009-05-04 21:10:20 UTC (rev 13061)
@@ -308,12 +308,18 @@
     my $circ = shift;
     my $attr = shift;
     my $copy = $circ->target_copy;
-    if($copy->call_number->id == OILS_PRECAT_CALL_NUMBER) {
+    if($copy->call_number->id == OILS_PRECAT_CALL_NUMBER or $copy->call_number->record->id == OILS_PRECAT_RECORD) {
         return $copy->dummy_title || '' if $attr eq 'title';
         return $copy->dummy_author || '' if $attr eq 'author';
     } else {
         $last_mvr = $U->record_to_mvr($copy->call_number->record)
             unless $last_mvr and $last_mvr->doc_id == $copy->call_number->record->id;
+
+        unless($last_mvr) {
+            $logger->error("failed to create mvr for circ  " . $circ->id);
+            return '';
+        }
+
         return $last_mvr->title || '' if $attr eq 'title';
         return $last_mvr->author || '' if $attr eq 'author';
     }



More information about the open-ils-commits mailing list