2 Fixes: Database update for file_library, failure during deactivate
authorChuck Scott <cscott@gaslightmedia.com>
Thu, 18 Jan 2018 16:40:01 +0000 (11:40 -0500)
committerChuck Scott <cscott@gaslightmedia.com>
Thu, 18 Jan 2018 16:42:34 +0000 (11:42 -0500)
Updated database update 1.1.33 to use NULL for DATETIME field for file_library table.
Commented out code in deactivate.php to remove current_user_can() call that can't be run there.

deactivate.php
setup/databaseScripts/create_database_V1.1.33.sql
setup/databaseScripts/update_database_V1.1.33.sql

index 352e8f0..2ced0eb 100644 (file)
@@ -54,9 +54,11 @@ class glmMembersPluginDeactivate extends glmPluginSupport
     {
 
         // Make sure the current user has this capability
+/*
         if (!current_user_can('activate_plugins')) {
             die();
         }
+*/
 
         // Check if there was an error and WP is calling us again
         if ($this->checkErrorScrape()) {
index 1fd8d26..5844b47 100644 (file)
@@ -292,7 +292,7 @@ CREATE TABLE {prefix}file_library (
   file_name TINYTEXT NULL,                  -- Stored file name for the file
   descr TEXT NULL,                          -- Description
   title TINYTEXT NULL,                      -- File title
-  last_access_time DATETIME DEFAULT NOW(),  -- Upload time or last access time
+  last_access_time DATETIME NULL,           -- Upload time or last access time
   PRIMARY KEY (id),
   INDEX(name(20)),
   INDEX(file_name(20))
index d17d8fe..7ae901f 100644 (file)
@@ -25,7 +25,7 @@ CREATE TABLE {prefix}file_library (
   file_name TINYTEXT NULL,                  -- Stored file name for the file
   descr TEXT NULL,                          -- Description
   title TINYTEXT NULL,                      -- File title
-  last_access_time DATETIME DEFAULT NOW(),  -- Upload time or last access time
+  last_access_time DATETIME NULL,           -- Upload time or last access time
   PRIMARY KEY (id),
   INDEX(name(20)),
   INDEX(file_name(20))