From 9a56bf98c1b5d7a739200617958096f6e8a2c768 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Tue, 31 Aug 2021 10:15:28 +0200 Subject: [PATCH] Bug 28373: DBRev 21.06.00.020 Signed-off-by: Jonathan Druart --- Koha.pm | 2 +- ...373_add_PassItemMarcToXSLT_preference.perl | 15 --------------- installer/data/mysql/db_revs/210600020.pl | 19 +++++++++++++++++++ 3 files changed, 20 insertions(+), 16 deletions(-) delete mode 100644 installer/data/mysql/atomicupdate/bug28373_add_PassItemMarcToXSLT_preference.perl create mode 100755 installer/data/mysql/db_revs/210600020.pl diff --git a/Koha.pm b/Koha.pm index 8b7fcc8a7c..b268e2863d 100644 --- a/Koha.pm +++ b/Koha.pm @@ -29,7 +29,7 @@ use vars qw{ $VERSION }; # - #4 : the developer version. The 4th number is the database subversion. # used by developers when the database changes. updatedatabase take care of the changes itself # and is automatically called by Auth.pm when needed. -$VERSION = "21.06.00.019"; +$VERSION = "21.06.00.020"; sub version { return $VERSION; diff --git a/installer/data/mysql/atomicupdate/bug28373_add_PassItemMarcToXSLT_preference.perl b/installer/data/mysql/atomicupdate/bug28373_add_PassItemMarcToXSLT_preference.perl deleted file mode 100644 index ef7ec1e5e8..0000000000 --- a/installer/data/mysql/atomicupdate/bug28373_add_PassItemMarcToXSLT_preference.perl +++ /dev/null @@ -1,15 +0,0 @@ -$DBversion = 'XXX'; -if( CheckVersion( $DBversion ) ) { - $dbh->do( q{ - INSERT IGNORE INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `type` ) VALUES - ('PassItemMarcToXSLT','0',NULL,'If enabled, item fields in the MARC record will be made avaiable to XSLT sheets. Otherwise they will be removed.','YesNo'); - }); - foreach my $pref ('XSLTDetailsDisplay','XSLTListsDisplay','XSLTResultsDisplay','OPACXSLTDetailsDisplay','OPACXSLTListsDisplay','OPACXSLTResultsDisplay'){ - if( C4::Context->preference($pref) ne 'default' ){ - print "NOTE: You have defined a custom stylesheet. If your custom stylesheets are utilizing item fields you must enable the system preference 'PassItemMarcToXSLT'\n"; - last; - } - } - - NewVersion( $DBversion, 28373, "Add PassItemMarcToXSLT system preference"); -} diff --git a/installer/data/mysql/db_revs/210600020.pl b/installer/data/mysql/db_revs/210600020.pl new file mode 100755 index 0000000000..316b825d03 --- /dev/null +++ b/installer/data/mysql/db_revs/210600020.pl @@ -0,0 +1,19 @@ +use Modern::Perl; + +return { + bug_number => "28373", + description => "Add new system preference PassItemMarcToXSLT", + up => sub { + my ($args) = @_; + my ($dbh, $out) = @$args{qw(dbh out)}; + $dbh->do( q{ + INSERT IGNORE INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `type` ) VALUES + ('PassItemMarcToXSLT','0',NULL,'If enabled, item fields in the MARC record will be made avaiable to XSLT sheets. Otherwise they will be removed.','YesNo'); + }); + foreach my $pref ('XSLTDetailsDisplay','XSLTListsDisplay','XSLTResultsDisplay','OPACXSLTDetailsDisplay','OPACXSLTListsDisplay','OPACXSLTResultsDisplay'){ + if( C4::Context->preference($pref) ne 'default' ){ + say $out "NOTE: You have defined a custom stylesheet for '$pref'. If it is utilizing item fields you must enable the system preference 'PassItemMarcToXSLT'"; + } + } + }, +} -- 2.39.5