From: Jason Stephenson Date: Wed, 30 Oct 2013 15:05:45 +0000 (-0400) Subject: LP#1246371: Allow BibCommon::title_is_empty to accept a bre id or bre object. X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=984b402b68c945663e2cf2053cdd9f697198e932;p=evergreen%2Fmasslnc.git LP#1246371: Allow BibCommon::title_is_empty to accept a bre id or bre object. I was trying to delete copies with the record fleshed in the call number object and got the following error: Can't use an undefined value as an ARRAY reference at /usr/local/share/perl/5.14.2/OpenILS/Application/Cat/BibCommon.pm line 399 Having title_is_empty check for a bre object and use its id solved this problem for me. Signed-off-by: Jason Stephenson Signed-off-by: Galen Charlton --- diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Cat/BibCommon.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Cat/BibCommon.pm index ff2c3ab72d..0e9da73c4a 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Cat/BibCommon.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Cat/BibCommon.pm @@ -391,6 +391,10 @@ sub delete_rec { sub title_is_empty { my($class, $editor, $rid, $vol_id) = @_; + # check if $rid is an object, because may be passing the volume + # with a fleshed record in one of our callers. + $rid = $rid->id() if (ref($rid)); + return 0 if $rid == OILS_PRECAT_RECORD; my $cnlist = $editor->search_asset_call_number(