From 70ea33f1e7a4606ea869261b243f9f6a869e9b5e Mon Sep 17 00:00:00 2001 From: erickson Date: Mon, 4 May 2009 21:10:20 +0000 Subject: [PATCH] add some protection against partially cataloged pre-cat copies git-svn-id: svn://svn.open-ils.org/ILS/branches/rel_1_4@13061 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- Open-ILS/src/support-scripts/generate_circ_notices.pl | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Open-ILS/src/support-scripts/generate_circ_notices.pl b/Open-ILS/src/support-scripts/generate_circ_notices.pl index 46a3ae42bd..46acd754fe 100755 --- a/Open-ILS/src/support-scripts/generate_circ_notices.pl +++ b/Open-ILS/src/support-scripts/generate_circ_notices.pl @@ -308,12 +308,18 @@ sub get_bib_attr { 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'; } -- 2.11.0