From 3f16d3b8e5d9f5deed2705d2de684b2e5850e210 Mon Sep 17 00:00:00 2001 From: Tomas Cohen Arazi Date: Thu, 2 May 2019 11:42:18 -0300 Subject: [PATCH] Bug 21073: (QA follow-up) Atomic update shouldn't fail if plugins are disabled Signed-off-by: Tomas Cohen Arazi Signed-off-by: Agustin Moyano Signed-off-by: Tomas Cohen Arazi Signed-off-by: Kyle M Hall Signed-off-by: Martin Renvoize --- .../data/mysql/atomicupdate/plugin_methods.perl | 37 +++++++++++----------- 1 file changed, 19 insertions(+), 18 deletions(-) rewrite installer/data/mysql/atomicupdate/plugin_methods.perl (84%) diff --git a/installer/data/mysql/atomicupdate/plugin_methods.perl b/installer/data/mysql/atomicupdate/plugin_methods.perl dissimilarity index 84% index 03f80a9d11..6d10bf2d82 100644 --- a/installer/data/mysql/atomicupdate/plugin_methods.perl +++ b/installer/data/mysql/atomicupdate/plugin_methods.perl @@ -1,18 +1,19 @@ -$DBversion = 'XXX'; # will be replaced by the RM -if( CheckVersion( $DBversion ) ) { - - $dbh->do(q{ - CREATE TABLE IF NOT EXISTS plugin_methods ( - plugin_class varchar(255) NOT NULL, - plugin_method varchar(255) NOT NULL, - PRIMARY KEY ( `plugin_class` (191), `plugin_method` (191) ) - ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; - }); - - require Koha::Plugins; - Koha::Plugins->new()->InstallPlugins; - - # Always end with this (adjust the bug info) - SetVersion( $DBversion ); - print "Upgrade to $DBversion done (Bug XXXXX - description)\n"; -} +$DBversion = 'XXX'; +if( CheckVersion( $DBversion ) ) { + + unless ( TableExists('plugin_methods') ) { + $dbh->do(q{ + CREATE TABLE plugin_methods ( + plugin_class varchar(255) NOT NULL, + plugin_method varchar(255) NOT NULL, + PRIMARY KEY ( `plugin_class` (191), `plugin_method` (191) ) + ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; + }); + } + + require Koha::Plugins; + Koha::Plugins->new({ enable_plugins => 1 })->InstallPlugins; + + SetVersion( $DBversion ); + print "Upgrade to $DBversion done (Bug 21073 - Improve plugin performance)\n"; +} -- 2.11.4.GIT