From: Jason Stephenson Date: Thu, 11 Oct 2018 12:50:30 +0000 (-0400) Subject: LP 1333893: Keep Empty Bib on Volume Transfer X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=refs%2Fheads%2Fuser%2Fdyrcona%2Flp1333893-volume-transfer-keep-empty-bib;p=working%2FEvergreen.git LP 1333893: Keep Empty Bib on Volume Transfer Volume transfer did not honor the cat.bib_keep_on_empty organizational unit setting when removing empty bib records. This commit changes it so that it does in the same manner that deleting copies and volumes does. To test this fix, set cat.bib_keep_on_empty for your workstation org. unit to true, and then transfer all of the volumes from one bib record to another. The empty bib record should not get deleted. You can also test with the setting on false to make sure that the empty bib gets deleted. Signed-off-by: Jason Stephenson --- diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Cat.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Cat.pm index dd8c730ccf..b680235815 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Cat.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Cat.pm @@ -1445,12 +1445,14 @@ sub batch_volume_transfer { } # Now see if any empty records need to be deleted after all of this - - for(@rec_ids) { - $logger->debug("merge: seeing if we should delete record $_..."); - $evt = OpenILS::Application::Cat::BibCommon->delete_rec($e, $_) - if OpenILS::Application::Cat::BibCommon->title_is_empty($e, $_); - return $evt if $evt; + my $keep_on_empty = $U->ou_ancestor_setting_value($e->requestor->ws_ou, 'cat.bib.keep_on_empty', $e); + unless ($U->is_true($keep_on_empty)) { + for (@rec_ids) { + $logger->debug("merge: seeing if we should delete record $_..."); + $evt = OpenILS::Application::Cat::BibCommon->delete_rec($e, $_) + if OpenILS::Application::Cat::BibCommon->title_is_empty($e, $_); + return $evt if $evt; + } } }