Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Now see if any empty records need to be deleted after all of this
- 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 $_...");
- if (OpenILS::Application::Cat::BibCommon->title_is_empty($e, $_)) {
- # Retarget any active title holds to the new bib record
- # before we blow it away
- my $retarget_holds = ();
- my $title_holds = $e->search_action_hold_request(
- {
- fulfillment_time => undef,
- cancel_time => undef,
- hold_type => 'T',
- target => $_
- });
- foreach my $hold (@$title_holds) {
- push (@$retarget_holds, $hold->id);
- $hold->target = $rec;
- return $e->die_event unless($e->update_action_hold_request($hold));
- }
- reset_hold_list($auth, $retarget_holds);
- $evt = OpenILS::Application::Cat::BibCommon->delete_rec($e, $_);
- return $evt if $evt;
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement