Bugzilla – Attachment 103954 Details for
Bug 25313
Add optional skip_merge parameter to ModAuthority
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 25313: Add skip_merge to ModAuthority
Bug-25313-Add-skipmerge-to-ModAuthority.patch (text/plain), 1.98 KB, created by
Marcel de Rooy
on 2020-04-29 14:49:05 UTC
(
hide
)
Description:
Bug 25313: Add skip_merge to ModAuthority
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2020-04-29 14:49:05 UTC
Size:
1.98 KB
patch
obsolete
>From dcae773ebb077cf16a43b9d7d54b671075dbb926 Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Wed, 29 Apr 2020 16:19:00 +0200 >Subject: [PATCH] Bug 25313: Add skip_merge to ModAuthority >Content-Type: text/plain; charset=utf-8 > >Sometimes you know that the merge is useless, since the reporting >tag did not change. >Might be handy in batch processing of authority records. > >Test plan: >Pick an authority with a few linked biblio recs (so that it will >immediately merge; lower than MergeLimit). >Open authority record and save it. >Verify that a linked biblio record was merged. Check time in 005. >You proved that this patch does not break the regular process. > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >--- > C4/AuthoritiesMarc.pm | 7 ++++--- > 1 file changed, 4 insertions(+), 3 deletions(-) > >diff --git a/C4/AuthoritiesMarc.pm b/C4/AuthoritiesMarc.pm >index 9d059a0266..08bb925504 100644 >--- a/C4/AuthoritiesMarc.pm >+++ b/C4/AuthoritiesMarc.pm >@@ -657,18 +657,19 @@ sub DelAuthority { > > =head2 ModAuthority > >- $authid= &ModAuthority($authid,$record,$authtypecode) >+ $authid= &ModAuthority($authid,$record,$authtypecode, [ { skip_merge => 1 ] ) > > Modifies authority record, optionally updates attached biblios. >+The parameter skip_merge is optional and should be used with care. > > =cut > > sub ModAuthority { >- my ( $authid, $record, $authtypecode ) = @_; >+ my ( $authid, $record, $authtypecode, $params ) = @_; > my $oldrecord = GetAuthority($authid); > #Now rewrite the $record to table with an add > $authid = AddAuthority($record, $authid, $authtypecode); >- merge({ mergefrom => $authid, MARCfrom => $oldrecord, mergeto => $authid, MARCto => $record }); >+ merge({ mergefrom => $authid, MARCfrom => $oldrecord, mergeto => $authid, MARCto => $record }) if !$params->{skip_merge}; > logaction( "AUTHORITIES", "MODIFY", $authid, "authority BEFORE=>" . $oldrecord->as_formatted ) if C4::Context->preference("AuthoritiesLog"); > return $authid; > } >-- >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 25313
:
103954
|
104217
|
108055
|
108056
|
108057