From 1758c8bc5da3c7d54f7537c80027dae0c369d847 Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Mon, 8 Apr 2019 10:28:38 +0100 Subject: [PATCH] Bug 22318: (QA follow-up) Correct name of atomicupdate Signed-off-by: Martin Renvoize Signed-off-by: Nick Clemens --- .../bug_22313-move-opacnavright-to-news.perl | 18 ------------------ .../bug_22318-move-opacnavright-to-news.perl | 18 ++++++++++++++++++ 2 files changed, 18 insertions(+), 18 deletions(-) delete mode 100644 installer/data/mysql/atomicupdate/bug_22313-move-opacnavright-to-news.perl create mode 100644 installer/data/mysql/atomicupdate/bug_22318-move-opacnavright-to-news.perl diff --git a/installer/data/mysql/atomicupdate/bug_22313-move-opacnavright-to-news.perl b/installer/data/mysql/atomicupdate/bug_22313-move-opacnavright-to-news.perl deleted file mode 100644 index bce5c64..0000000 --- a/installer/data/mysql/atomicupdate/bug_22313-move-opacnavright-to-news.perl +++ /dev/null @@ -1,18 +0,0 @@ -$DBversion = 'XXX'; # will be replaced by the RM -if( CheckVersion( $DBversion ) ) { - my $opaclang = C4::Context->preference("opaclanguages"); - my @langs; - push @langs, split ( '\,', $opaclang ); - # Get any existing value from the OpacNavRight system preference - my ($OpacNavRight) = $dbh->selectrow_array( q| - SELECT value FROM systempreferences WHERE variable='OpacNavRight'; - |); - if( $OpacNavRight ){ - # If there is a value in the OpacNavRight preference, insert it into opac_news - $dbh->do("INSERT INTO opac_news (branchcode, lang, title, content ) VALUES (NULL, 'OpacNavRight_$langs[0]', '', '$OpacNavRight')"); - } - # Remove the OpacNavRight system preference - $dbh->do("DELETE FROM systempreferences WHERE variable='OpacNavRight'"); - SetVersion ($DBversion); - print "Upgrade to $DBversion done (Bug 22318: Move contents of OpacNavRight preference to Koha news system)\n"; -} diff --git a/installer/data/mysql/atomicupdate/bug_22318-move-opacnavright-to-news.perl b/installer/data/mysql/atomicupdate/bug_22318-move-opacnavright-to-news.perl new file mode 100644 index 0000000..bce5c64 --- /dev/null +++ b/installer/data/mysql/atomicupdate/bug_22318-move-opacnavright-to-news.perl @@ -0,0 +1,18 @@ +$DBversion = 'XXX'; # will be replaced by the RM +if( CheckVersion( $DBversion ) ) { + my $opaclang = C4::Context->preference("opaclanguages"); + my @langs; + push @langs, split ( '\,', $opaclang ); + # Get any existing value from the OpacNavRight system preference + my ($OpacNavRight) = $dbh->selectrow_array( q| + SELECT value FROM systempreferences WHERE variable='OpacNavRight'; + |); + if( $OpacNavRight ){ + # If there is a value in the OpacNavRight preference, insert it into opac_news + $dbh->do("INSERT INTO opac_news (branchcode, lang, title, content ) VALUES (NULL, 'OpacNavRight_$langs[0]', '', '$OpacNavRight')"); + } + # Remove the OpacNavRight system preference + $dbh->do("DELETE FROM systempreferences WHERE variable='OpacNavRight'"); + SetVersion ($DBversion); + print "Upgrade to $DBversion done (Bug 22318: Move contents of OpacNavRight preference to Koha news system)\n"; +} -- 1.7.2.5