Bug 21073: (QA follow-up) Atomic update shouldn't fail if plugins are disabled
authorTomas Cohen Arazi <tomascohen@theke.io>
Thu, 2 May 2019 14:42:18 +0000 (11:42 -0300)
committerMartin Renvoize <martin.renvoize@ptfs-europe.com>
Tue, 18 Jun 2019 16:29:35 +0000 (17:29 +0100)
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Agustin Moyano <agustinmoyano@theke.io>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

installer/data/mysql/atomicupdate/plugin_methods.perl

index 03f80a9..6d10bf2 100644 (file)
@@ -1,18 +1,19 @@
-$DBversion = 'XXX';  # will be replaced by the RM
+$DBversion = 'XXX';
 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;
-    });
+    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()->InstallPlugins;
+    Koha::Plugins->new({ enable_plugins => 1 })->InstallPlugins;
 
-    # Always end with this (adjust the bug info)
     SetVersion( $DBversion );
-    print "Upgrade to $DBversion done (Bug XXXXX - description)\n";
+    print "Upgrade to $DBversion done (Bug 21073 - Improve plugin performance)\n";
 }