From d60e54c407be5f240e3b18cb65e1605ea50bb62f Mon Sep 17 00:00:00 2001 From: Marcel de Rooy Date: Tue, 10 Jan 2017 11:39:31 +0100 Subject: [PATCH] Bug 9988: Database revision for AuthorityMergeLimit Content-Type: text/plain; charset=utf-8 Introduce the new preference and remove dontmerge. If dontmerge was enabled, the new pref will be set to a lower number. Test plan: Run the database revision or a new install. In case of an upgrade, check the new pref value. Should be 10 when dontmerge was enabled, otherwise 50. Signed-off-by: Marcel de Rooy Also tested sysprefs.sql on a new database. --- installer/data/mysql/atomicupdate/bug_9988.perl | 16 ++++++++++++++++ installer/data/mysql/sysprefs.sql | 2 +- .../prog/en/modules/admin/preferences/authorities.pref | 10 ++++------ 3 files changed, 21 insertions(+), 7 deletions(-) create mode 100644 installer/data/mysql/atomicupdate/bug_9988.perl diff --git a/installer/data/mysql/atomicupdate/bug_9988.perl b/installer/data/mysql/atomicupdate/bug_9988.perl new file mode 100644 index 0000000..a5e2889 --- /dev/null +++ b/installer/data/mysql/atomicupdate/bug_9988.perl @@ -0,0 +1,16 @@ +$DBversion = 'XXX'; # will be replaced by the RM +if( CheckVersion( $DBversion ) ) { + my $oldval = C4::Context->preference('dontmerge'); + my $newval = $oldval ? 10 : 50; + + # Remove dontmerge, add AuthorityMergeLimit + $dbh->do(q/ +DELETE FROM systempreferences WHERE variable = 'dontmerge'; + /); + $dbh->do(qq/ +INSERT IGNORE INTO systempreferences ( variable, value, options, explanation, type ) VALUES ('AuthorityMergeLimit','$newval',NULL,'Maximum number of biblio records updated immediately when an authority record has been modified.','integer'); + /); + + SetVersion( $DBversion ); + print "Upgrade to $DBversion done (Bug 9988 - Add AuthorityMergeLimit)\n"; +} diff --git a/installer/data/mysql/sysprefs.sql b/installer/data/mysql/sysprefs.sql index 423bbdf..31a41a1 100644 --- a/installer/data/mysql/sysprefs.sql +++ b/installer/data/mysql/sysprefs.sql @@ -52,6 +52,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` ('AudioAlerts','0','','Enable circulation sounds during checkin and checkout in the staff interface. Not supported by all web browsers yet.','YesNo'), ('AuthDisplayHierarchy','0','','Display authority hierarchies','YesNo'), ('AuthoritiesLog','1',NULL,'If ON, log edit/create/delete actions on authorities.','YesNo'), +('AuthorityMergeLimit','50',NULL,'Maximum number of biblio records updated immediately when an authority record has been modified.','integer'), ('AuthoritySeparator','--','10','Used to separate a list of authorities in a display. Usually --','free'), ('autoBarcode','OFF','incremental|annual|hbyymmincr|EAN13|OFF','Used to autogenerate a barcode: incremental will be of the form 1, 2, 3; annual of the form 2007-0001, 2007-0002; hbyymmincr of the form HB08010001 where HB=Home Branch','Choice'), ('AutoCreateAuthorities','0',NULL,'Automatically create authorities that do not exist when cataloging records.','YesNo'), @@ -136,7 +137,6 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` ('DisplayLibraryFacets', 'holding', 'home|holding|both', 'Defines which library facets to display.', 'Choice'), ('DisplayMultiPlaceHold','1','','Display the ability to place multiple holds or not','YesNo'), ('DisplayOPACiconsXSLT','1','','If ON, displays the format, audience, and material type icons in XSLT MARC21 results and detail pages in the OPAC.','YesNo'), -('dontmerge','1',NULL,'If ON, modifying an authority record will not update all associated bibliographic records immediately, ask your system administrator to enable the merge_authorities.pl cron job','YesNo'), ('DumpTemplateVarsIntranet', '0', NULL , 'If enabled, dump all Template Toolkit variable to a comment in the html source for the staff intranet.', 'YesNo'), ('DumpTemplateVarsOpac', '0', NULL , 'If enabled, dump all Template Toolkit variable to a comment in the html source for the opac.', 'YesNo'), ('EasyAnalyticalRecords','0','','If on, display in the catalogue screens tools to easily setup analytical record relationships','YesNo'), diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/authorities.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/authorities.pref index 2762411..3f0de66 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/authorities.pref +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/authorities.pref @@ -24,12 +24,10 @@ Authorities: no: "do not generate" - authority records that are missing (BiblioAddsAuthorities must be set to "allow" for this to have any effect). - - - pref: dontmerge - default: yes - choices: - yes: "Don't" - no: Do - - automatically update attached biblios when changing an authority record. If this is off, please ask your administrator to enable the merge_authority.pl cronjob. + - When modifying an authority record, do not update attached biblio records if the number exceeds + - pref: AuthorityMergeLimit + default: 50 + - records. (Above this limit, the merge_authority cron job will merge them.) - - Use the following text for the contents of MARC21 authority control field 008 position 06-39 (fixed length data elements). Do NOT include the date (position 00-05). - pref: MARCAuthorityControlField008 -- 2.1.4