Bugzilla – Attachment 61788 Details for
Bug 9988
Leave larger authority merges to merge_authorities cronjob (pref AuthorityMergeLimit)
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 9988: Remove further references to dontmerge
Bug-9988-Remove-further-references-to-dontmerge.patch (text/plain), 4.46 KB, created by
Marcel de Rooy
on 2017-04-03 08:31:43 UTC
(
hide
)
Description:
Bug 9988: Remove further references to dontmerge
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2017-04-03 08:31:43 UTC
Size:
4.46 KB
patch
obsolete
>From 087c94cb1720e3702e25b55920c4f813d64c2318 Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Wed, 22 Feb 2017 10:53:03 +0100 >Subject: [PATCH] Bug 9988: Remove further references to dontmerge >Content-Type: text/plain; charset=utf-8 > >[1] The preference was sent to HEA. We can now send both AuthorityMergeMode > as well as AuthorityMergeLimit. >[2] A comment in authorities/merge.pl is removed. Note that a subsequent > patch will modify and test the cron job. >[3] Script misc/batchRebuildItemsTables.pl temporarily enabled dontmerge. > This is equivalent to setting the mergelimit to zero. > The function defnonull is no longer needed. (If the pref was NULL, > we restore that value. Sub merge won't mind.) > >Test plan: >[1] Run t/db_dependent/UsageStats.t >[2] Run misc/batchRebuildItemsTables.pl -t > This just ensures you it still compiles; the changes speak for itself. >[3] Now git grep on dontmerge. > You should only find hits in atomicupdate and misc/translator/po. > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >--- > C4/UsageStats.pm | 3 ++- > authorities/merge.pl | 1 - > misc/batchRebuildItemsTables.pl | 14 ++++---------- > t/db_dependent/UsageStats.t | 3 ++- > 4 files changed, 8 insertions(+), 13 deletions(-) > >diff --git a/C4/UsageStats.pm b/C4/UsageStats.pm >index 16f86df..96e79fa 100644 >--- a/C4/UsageStats.pm >+++ b/C4/UsageStats.pm >@@ -108,7 +108,8 @@ sub BuildReport { > AuthDisplayHierarchy > AutoCreateAuthorities > BiblioAddsAuthorities >- dontmerge >+ AuthorityMergeLimit >+ AuthorityMergeMode > UseAuthoritiesForTracings > CatalogModuleRelink > hide_marc >diff --git a/authorities/merge.pl b/authorities/merge.pl >index 94bfc3d..4279fef 100755 >--- a/authorities/merge.pl >+++ b/authorities/merge.pl >@@ -62,7 +62,6 @@ if ($merge) { > ModAuthority( $recordid1, $record, $typecode ); > > # Now merge for biblios attached to $recordid2 >- # We ignore dontmerge now, since recordid2 is deleted > my $MARCfrom = GetAuthority( $recordid2 ); > merge({ mergefrom => $recordid2, MARCfrom => $MARCfrom, mergeto => $recordid1, MARCto => $record }); > >diff --git a/misc/batchRebuildItemsTables.pl b/misc/batchRebuildItemsTables.pl >index 9e38757..5545607 100755 >--- a/misc/batchRebuildItemsTables.pl >+++ b/misc/batchRebuildItemsTables.pl >@@ -52,10 +52,9 @@ $dbh->{AutoCommit} = 0; > #sysprefs > C4::Context->disable_syspref_cache() if ( defined( C4::Context->disable_syspref_cache() ) ); > my $CataloguingLog = C4::Context->preference('CataloguingLog'); >-my $dontmerge = C4::Context->preference('dontmerge'); >-$dontmerge = "0" unless defnonull($dontmerge); >+my $mergelimit = C4::Context->preference('AuthorityMergeLimit'); > $dbh->do("UPDATE systempreferences SET value=0 WHERE variable='CataloguingLog'"); >-$dbh->do("UPDATE systempreferences SET value=1 where variable='dontmerge'"); >+$dbh->do("UPDATE systempreferences SET value=0 where variable='AuthorityMergeLimit'"); > $dbh->commit() unless $test_parameter; > my ( $itemfield, $itemnumbersubfield ) = &GetMarcFromKohaField( "items.itemnumber", '' ); > >@@ -98,16 +97,11 @@ while ( my ( $biblionumber, $biblioitemnumber, $frameworkcode ) = $sth->fetchrow > > my $sthCataloguingLog = $dbh->prepare("UPDATE systempreferences SET value=? WHERE variable='CataloguingLog'"); > $sthCataloguingLog->execute($CataloguingLog); >-my $sthdontmerge = $dbh->prepare("UPDATE systempreferences SET value=? WHERE variable='dontmerge'"); >-$sthdontmerge->execute($dontmerge); >+my $sthmergelimit = $dbh->prepare("UPDATE systempreferences SET value=? WHERE variable='AuthorityMergeLimit'"); >+$sthmergelimit->execute($mergelimit); > $dbh->commit() unless $test_parameter; > my $timeneeded = time() - $starttime; > print "$count MARC record done in $timeneeded seconds\n"; > if ( scalar(@errors) > 0 ) { > print "Some biblionumber could not be processed though: ", join( " ", @errors ); > } >- >-sub defnonull { >- my $var = shift; >- return defined $var && $var ne q{}; >-} >diff --git a/t/db_dependent/UsageStats.t b/t/db_dependent/UsageStats.t >index 6c19925..d11cbd4 100644 >--- a/t/db_dependent/UsageStats.t >+++ b/t/db_dependent/UsageStats.t >@@ -358,7 +358,8 @@ sub mocking_systempreferences_to_a_set_value { > AuthDisplayHierarchy > AutoCreateAuthorities > BiblioAddsAuthorities >- dontmerge >+ AuthorityMergeLimit >+ AuthorityMergeMode > UseAuthoritiesForTracings > CatalogModuleRelink > hide_marc >-- >2.1.4
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 9988
:
59158
|
59159
|
60256
|
60257
|
60258
|
60259
|
60594
|
60595
|
60596
|
60597
|
60598
|
60599
|
60600
|
60601
|
60602
|
60603
|
60604
|
60605
|
60606
|
60607
|
60668
|
60669
|
60670
|
60671
|
60672
|
60673
|
60674
|
60675
|
61306
|
61307
|
61308
|
61309
|
61779
|
61780
|
61781
|
61782
|
61783
|
61784
|
61785
|
61786
|
61787
|
61788
|
61789
|
61790
|
61791
|
61792
|
61890
|
61891
|
61892
|
61893
|
61894
|
61895
|
61897
|
61898
|
61899
|
61900
|
61901
|
61902
|
61903
|
61904
|
61912
|
61913
|
61914
|
61915
|
61916
|
61917
|
61918
|
61919
|
61920
|
61921
|
61922
|
61923
|
61924
|
61925
|
62055
|
62123
|
62124
|
62125
|
62126
|
62127
|
62128
|
62129
|
62130
|
62131
|
62132
|
62133
|
62134
|
62135
|
62136
|
62137