From: erickson Date: Mon, 4 May 2009 21:10:57 +0000 (+0000) Subject: add some protection against partially cataloged pre-cat copies X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=b165819399b73ebd07426cc8a5b5f7e3b399d7d9;p=evergreen%2Fbjwebb.git add some protection against partially cataloged pre-cat copies git-svn-id: svn://svn.open-ils.org/ILS/trunk@13062 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- diff --git a/Open-ILS/src/support-scripts/generate_circ_notices.pl b/Open-ILS/src/support-scripts/generate_circ_notices.pl index 46a3ae42b..46acd754f 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'; }