From c22934c3e6b7900f2400e13a073af4a7c123d635 Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Fri, 29 Apr 2016 13:51:00 +0000 Subject: [PATCH] Bug 16041 - DBRev 3.23.00.058 Signed-off-by: Kyle M Hall --- Koha.pm | 2 +- .../data/mysql/atomicupdate/bug_16041.perl | 23 ------------- installer/data/mysql/updatedatabase.pl | 33 +++++++++++++++++++ 3 files changed, 34 insertions(+), 24 deletions(-) delete mode 100644 installer/data/mysql/atomicupdate/bug_16041.perl diff --git a/Koha.pm b/Koha.pm index 641f9df3f9..4bfbada8ba 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 = "3.23.00.057"; +$VERSION = "3.23.00.058"; sub version { return $VERSION; diff --git a/installer/data/mysql/atomicupdate/bug_16041.perl b/installer/data/mysql/atomicupdate/bug_16041.perl deleted file mode 100644 index 809325c83a..0000000000 --- a/installer/data/mysql/atomicupdate/bug_16041.perl +++ /dev/null @@ -1,23 +0,0 @@ -my $dbh = C4::Context->dbh; -my ( $count_imageurl ) = $dbh->selectrow_array(q| - SELECT COUNT(*) - FROM authorised_values - WHERE imageurl IS NOT NULL - AND imageurl <> "" -|); -unless ( $count_imageurl ) { - if ( C4::Context->preference('AuthorisedValueImages') - or C4::Context->preference('StaffAuthorisedValueImages') ) { - $dbh->do(q| - UPDATE systempreferences - SET value=0 - WHERE variable="AuthorisedValueImages" - or variable="StaffAuthorisedValueImages" - |); - warn "The system preferences AuthorisedValueImages and StaffAuthorisedValueImages have been turned off\n"; - warn "authorised_values.imageurl is not populated, that means you are not using this feature\n" - } -} else { - warn "At least one authorised value has an icon defined (imageurl)\n"; - warn "The system preference AuthorisedValueImages or StaffAuthorisedValueImages could be turned off if you are not aware of this feature\n"; -} diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index eed4c233ca..f3f446328a 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -12492,6 +12492,39 @@ if ( CheckVersion($DBversion) ) { SetVersion($DBversion); } +$DBversion = "3.23.00.058"; +if ( CheckVersion($DBversion) ) { + + my ($count_imageurl) = $dbh->selectrow_array(q| + SELECT COUNT(*) + FROM authorised_values + WHERE imageurl IS NOT NULL + AND imageurl <> "" + |); + + unless ($count_imageurl) { + if ( C4::Context->preference('AuthorisedValueImages') + or C4::Context->preference('StaffAuthorisedValueImages') ) + { + $dbh->do(q| + UPDATE systempreferences + SET value = 0 + WHERE variable = "AuthorisedValueImages" + or variable = "StaffAuthorisedValueImages" + |); + warn "The system preferences AuthorisedValueImages and StaffAuthorisedValueImages have been turned off\n"; + warn "authorised_values.imageurl is not populated, that means you are not using this feature\n"; + } + } + else { + warn "At least one authorised value has an icon defined (imageurl)\n"; + warn "The system preference AuthorisedValueImages or StaffAuthorisedValueImages could be turned off if you are not aware of this feature\n"; + } + + print "Upgrade to $DBversion done (Bug 15531 - Add support for standing orders)\n"; + SetVersion($DBversion); +} + # DEVELOPER PROCESS, search for anything to execute in the db_update directory # SEE bug 13068 -- 2.39.5