From fff6e64ea92a273d678f186a42089c47ce13c189 Mon Sep 17 00:00:00 2001 From: miker Date: Thu, 17 Aug 2006 20:48:46 +0000 Subject: [PATCH] fixing minor MR mapping bug git-svn-id: svn://svn.open-ils.org/ILS/trunk@5575 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- .../perlmods/OpenILS/Application/Ingest.pm | 24 +++++++++++-------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/Open-ILS/src/perlmods/OpenILS/Application/Ingest.pm b/Open-ILS/src/perlmods/OpenILS/Application/Ingest.pm index f273597b21..b2633201f7 100644 --- a/Open-ILS/src/perlmods/OpenILS/Application/Ingest.pm +++ b/Open-ILS/src/perlmods/OpenILS/Application/Ingest.pm @@ -185,17 +185,21 @@ sub rw_biblio_ingest_single_object { { metarecord => $mr->id } )->gather(1); - my $best = $cstore->request( - "open-ils.cstore.direct.biblio.record_entry.search", - { id => [ map { $_->source } @$mrm ] }, - { 'select' => { bre => [ qw/id quality/ ] }, - order_by => { bre => "quality desc" }, - limit => 1, - } - )->gather(1); + if (@$mrm) { + my $best = $cstore->request( + "open-ils.cstore.direct.biblio.record_entry.search", + { id => [ map { $_->source } @$mrm ] }, + { 'select' => { bre => [ qw/id quality/ ] }, + order_by => { bre => "quality desc" }, + limit => 1, + } + )->gather(1); - if ($best->quality > $bib->quality) { - $mr->master_record($best->id); + if ($best->quality > $bib->quality) { + $mr->master_record($best->id); + } else { + $mr->master_record($bib->id); + } } else { $mr->master_record($bib->id); } -- 2.43.2