Bugzilla – Attachment 104559 Details for
Bug 22437
Subsequent authority merges in cron may cause biblios to lose authority information
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 22437: (follow-up) Move deletion of merge requests to DelAuthority
Bug-22437-follow-up-Move-deletion-of-merge-request.patch (text/plain), 2.44 KB, created by
Marcel de Rooy
on 2020-05-08 07:20:09 UTC
(
hide
)
Description:
Bug 22437: (follow-up) Move deletion of merge requests to DelAuthority
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2020-05-08 07:20:09 UTC
Size:
2.44 KB
patch
obsolete
>From 0c7d7ff97a3825487177dab613092bd256cae8f3 Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Fri, 8 May 2020 06:46:59 +0000 >Subject: [PATCH] Bug 22437: (follow-up) Move deletion of merge requests to > DelAuthority >Content-Type: text/plain; charset=utf-8 > >Lines can be moved. Deletion can be done too if skip_merge is not set. > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >--- > C4/AuthoritiesMarc.pm | 7 ++++++- > authorities/merge.pl | 6 +----- > 2 files changed, 7 insertions(+), 6 deletions(-) > >diff --git a/C4/AuthoritiesMarc.pm b/C4/AuthoritiesMarc.pm >index 9d059a0266..c2aade898c 100644 >--- a/C4/AuthoritiesMarc.pm >+++ b/C4/AuthoritiesMarc.pm >@@ -29,7 +29,7 @@ use C4::Charset; > use C4::Log; > use Koha::MetadataRecord::Authority; > use Koha::Authorities; >-use Koha::Authority::MergeRequest; >+use Koha::Authority::MergeRequests; > use Koha::Authority::Types; > use Koha::Authority; > use Koha::Libraries; >@@ -649,6 +649,11 @@ sub DelAuthority { > my $authid = $params->{authid} || return; > my $skip_merge = $params->{skip_merge}; > my $dbh = C4::Context->dbh; >+ >+ # Remove older pending merge requests for $authid to itself. (See bug 22437) >+ my $condition = { authid => $authid, authid_new => [undef, 0, $authid], done => 0 }; >+ Koha::Authority::MergeRequests->search($condition)->delete; >+ > merge({ mergefrom => $authid }) if !$skip_merge; > $dbh->do( "DELETE FROM auth_header WHERE authid=?", undef, $authid ); > logaction( "AUTHORITIES", "DELETE", $authid, "authority" ) if C4::Context->preference("AuthoritiesLog"); >diff --git a/authorities/merge.pl b/authorities/merge.pl >index 5b8c4fb260..37043bb5b5 100755 >--- a/authorities/merge.pl >+++ b/authorities/merge.pl >@@ -83,11 +83,7 @@ if ($merge) { > my $MARCfrom = GetAuthority( $recordid2 ); > merge({ mergefrom => $recordid2, MARCfrom => $MARCfrom, mergeto => $recordid1, MARCto => $record }); > >- # Delete the other record. Do not merge. It is unneeded and could under >- # special circumstances have unwanted side-effects. >- # Remove older pending merge requests for $recordid2 to itself. The above merge did the job already or will do. (See bug 22437) >- my $condition = { authid => $recordid2, authid_new => [undef, 0, $recordid2], done => 0 }; >- Koha::Authority::MergeRequests->search($condition)->delete; >+ # Delete the other record. No need to merge. > DelAuthority({ authid => $recordid2, skip_merge => 1 }); > > # Parameters >-- >2.11.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 22437
:
95836
|
95848
|
102338
|
102444
|
102445
|
103298
|
103299
|
104557
|
104558
|
104559
|
104698
|
104699
|
104700