From 2c10ac831bc6130b69ab295755160684ad9ccc15 Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Mon, 21 Oct 2019 09:56:43 +0100 Subject: [PATCH] Bug 23791: DBRev 19.06.00.041 Signed-off-by: Martin Renvoize --- Koha.pm | 2 +- .../bug_23791-opac-social-network-selection.perl | 14 -------------- installer/data/mysql/updatedatabase.pl | 15 +++++++++++++++ 3 files changed, 16 insertions(+), 15 deletions(-) delete mode 100644 installer/data/mysql/atomicupdate/bug_23791-opac-social-network-selection.perl diff --git a/Koha.pm b/Koha.pm index 2a4428f5c2..2d825d16b9 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 = "19.06.00.040"; +$VERSION = "19.06.00.041"; sub version { return $VERSION; diff --git a/installer/data/mysql/atomicupdate/bug_23791-opac-social-network-selection.perl b/installer/data/mysql/atomicupdate/bug_23791-opac-social-network-selection.perl deleted file mode 100644 index 4b4c7381c0..0000000000 --- a/installer/data/mysql/atomicupdate/bug_23791-opac-social-network-selection.perl +++ /dev/null @@ -1,14 +0,0 @@ -$DBversion = 'XXX'; # will be replaced by the RM -if( CheckVersion( $DBversion ) ) { - my ($socialnetworks) = $dbh->selectrow_array( q| - SELECT value FROM systempreferences WHERE variable='socialnetworks'; - |); - if( $socialnetworks ){ - # If the socialnetworks preference is enabled, enable all social networks - $dbh->do("UPDATE systempreferences SET value = 'email,facebook,linkedin,twitter', explanation = 'email|facebook|linkedin|twitter', type = 'multiple' WHERE variable = 'SocialNetworks'"); - } else { - $dbh->do("UPDATE systempreferences SET value = '', explanation = 'email|facebook|linkedin|twitter', type = 'multiple' WHERE variable = 'SocialNetworks'"); - } - SetVersion ($DBversion); - print "Upgrade to $DBversion done (Bug 22880: Allow granular control of socialnetworks preference)\n"; -} diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index 2570cd8a28..cf00117a53 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -19676,6 +19676,21 @@ if( CheckVersion( $DBversion ) ) { print "Upgrade to $DBversion done (Bug 17140 - Add pref to allow rounding fines at payment)\n"; } +$DBversion = '19.06.00.041'; +if( CheckVersion( $DBversion ) ) { + my ($socialnetworks) = $dbh->selectrow_array( q| + SELECT value FROM systempreferences WHERE variable='socialnetworks'; + |); + if( $socialnetworks ){ + # If the socialnetworks preference is enabled, enable all social networks + $dbh->do("UPDATE systempreferences SET value = 'email,facebook,linkedin,twitter', explanation = 'email|facebook|linkedin|twitter', type = 'multiple' WHERE variable = 'SocialNetworks'"); + } else { + $dbh->do("UPDATE systempreferences SET value = '', explanation = 'email|facebook|linkedin|twitter', type = 'multiple' WHERE variable = 'SocialNetworks'"); + } + SetVersion ($DBversion); + print "Upgrade to $DBversion done (Bug 22880: Allow granular control of socialnetworks preference)\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/'; -- 2.39.5