Bug 22880: DBRev 19.12.00.030
authorMartin Renvoize <martin.renvoize@ptfs-europe.com>
Mon, 24 Feb 2020 13:30:13 +0000 (13:30 +0000)
committerMartin Renvoize <martin.renvoize@ptfs-europe.com>
Mon, 24 Feb 2020 13:31:26 +0000 (13:31 +0000)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Koha.pm
installer/data/mysql/atomicupdate/bug_22880-move-opacheader-to-news.perl [deleted file]
installer/data/mysql/updatedatabase.pl

diff --git a/Koha.pm b/Koha.pm
index 3515c62..aac9323 100644 (file)
--- 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 = "19.12.00.029";
+$VERSION = "19.12.00.030";
 
 sub version {
     return $VERSION;
diff --git a/installer/data/mysql/atomicupdate/bug_22880-move-opacheader-to-news.perl b/installer/data/mysql/atomicupdate/bug_22880-move-opacheader-to-news.perl
deleted file mode 100644 (file)
index 9c6df3c..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-$DBversion = 'XXX'; # will be replaced by the RM
-if( CheckVersion( $DBversion ) ) {
-
-    # get list of installed translations
-    require C4::Languages;
-    my @langs;
-    my $tlangs = C4::Languages::getTranslatedLanguages();
-
-    foreach my $language ( @$tlangs ) {
-        foreach my $sublanguage ( @{$language->{'sublanguages_loop'}} ) {
-            push @langs, $sublanguage->{'rfc4646_subtag'};
-        }
-    }
-
-    # Get any existing value from the opacheader system preference
-    my ($opacheader) = $dbh->selectrow_array( q|
-        SELECT value FROM systempreferences WHERE variable='opacheader';
-    |);
-    if( $opacheader ){
-        foreach my $lang ( @langs ) {
-            print "Inserting opacheader contents into $lang news item...\n";
-            # If there is a value in the opacheader preference, insert it into opac_news
-            $dbh->do("INSERT INTO opac_news (branchcode, lang, title, content ) VALUES (NULL, ?, '', ?)", undef, "opacheader_$langs[0]", $opacheader);
-        }
-    }
-    # Remove the opacheader system preference
-    $dbh->do("DELETE FROM systempreferences WHERE variable='opacheader'");
-    SetVersion ($DBversion);
-    print "Upgrade to $DBversion done (Bug 22880: Move contents of opacheader preference to Koha news system)\n";
-}
index 439eae5..065a02b 100755 (executable)
@@ -20925,6 +20925,37 @@ if( CheckVersion( $DBversion ) ) {
     print "Upgrade to $DBversion done (Bug 17702 - Add column account_credit_types.archived)\n";
 }
 
+$DBversion = '19.12.00.030';
+if( CheckVersion( $DBversion ) ) {
+
+    # get list of installed translations
+    require C4::Languages;
+    my @langs;
+    my $tlangs = C4::Languages::getTranslatedLanguages();
+
+    foreach my $language ( @$tlangs ) {
+        foreach my $sublanguage ( @{$language->{'sublanguages_loop'}} ) {
+            push @langs, $sublanguage->{'rfc4646_subtag'};
+        }
+    }
+
+    # Get any existing value from the opacheader system preference
+    my ($opacheader) = $dbh->selectrow_array( q|
+        SELECT value FROM systempreferences WHERE variable='opacheader';
+    |);
+    if( $opacheader ){
+        foreach my $lang ( @langs ) {
+            print "Inserting opacheader contents into $lang news item...\n";
+            # If there is a value in the opacheader preference, insert it into opac_news
+            $dbh->do("INSERT INTO opac_news (branchcode, lang, title, content ) VALUES (NULL, ?, '', ?)", undef, "opacheader_$langs[0]", $opacheader);
+        }
+    }
+    # Remove the opacheader system preference
+    $dbh->do("DELETE FROM systempreferences WHERE variable='opacheader'");
+    SetVersion ($DBversion);
+    print "Upgrade to $DBversion done (Bug 22880: Move contents of opacheader preference to Koha news system)\n";
+}
+
 # SEE bug 13068
 # if there is anything in the atomicupdate, read and execute it.
 my $update_dir = C4::Context->config('intranetdir') . '/installer/data/mysql/atomicupdate/';