From 6db90c0cb97a9d03669d97bbc7465a6a27ff16f0 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Thu, 6 Jul 2017 14:28:18 -0300 Subject: [PATCH] Bug 18801: DBRev 17.05.00.003 (cherry picked from commit 83e4adf0abff0e81febf4bcee473ce9c599e8311) --- Koha.pm | 2 +- .../data/mysql/atomicupdate/bug18801.perl | 15 ------------- installer/data/mysql/updatedatabase.pl | 21 +++++++++++++++++++ 3 files changed, 22 insertions(+), 16 deletions(-) delete mode 100644 installer/data/mysql/atomicupdate/bug18801.perl diff --git a/Koha.pm b/Koha.pm index a387f9aece..ce1e8c4ad0 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 = "17.05.05.001"; +$VERSION = "17.05.05.002"; sub version { return $VERSION; diff --git a/installer/data/mysql/atomicupdate/bug18801.perl b/installer/data/mysql/atomicupdate/bug18801.perl deleted file mode 100644 index 8a8fd50615..0000000000 --- a/installer/data/mysql/atomicupdate/bug18801.perl +++ /dev/null @@ -1,15 +0,0 @@ -$DBversion = 'XXX'; # will be replaced by the RM -if( CheckVersion( $DBversion ) ) { - # Fetch all auth types - my $authtypes = $dbh->selectcol_arrayref( q|SELECT authtypecode FROM auth_types| ); - - if( grep { $_ eq 'Default' } @$authtypes ) { - # If this exists as an authtypecode, we don't do anything - } else { - # Replace the incorrect Default by empty string - $dbh->do( q|UPDATE auth_header SET authtypecode='' WHERE authtypecode='Default'| ); - } - - SetVersion( $DBversion ); - print "Upgrade to $DBversion done (Bug 18801 - Update incorrect Default auth type codes)\n"; -} diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index 39bf716a8d..f57d78ad61 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -14561,6 +14561,27 @@ if( CheckVersion( $DBversion ) ) { print "Upgrade to $DBversion done (Bug 18811 - Visibility settings inconsistent between framework and authority editor)\n"; } +$DBversion = '17.05.05.002'; +if ( CheckVersion($DBversion) ) { + + # Fetch all auth types + my $authtypes = $dbh->selectcol_arrayref(q|SELECT authtypecode FROM auth_types|); + + if ( grep { $_ eq 'Default' } @$authtypes ) { + + # If this exists as an authtypecode, we don't do anything + } + else { + # Replace the incorrect Default by empty string + $dbh->do(q| + UPDATE auth_header SET authtypecode='' WHERE authtypecode='Default' + |); + } + + SetVersion($DBversion); + print "Upgrade to $DBversion done (Bug 18801 - Update incorrect Default auth type codes)\n"; +} + # DEVELOPER PROCESS, search for anything to execute in the db_update directory # SEE bug 13068 # if there is anything in the atomicupdate, read and execute it. -- 2.39.5