From 1b49f12c185a1b70116b858ba3f8590ed5ae7aaa Mon Sep 17 00:00:00 2001 From: Chuck Scott Date: Thu, 18 Jan 2018 11:40:01 -0500 Subject: [PATCH] 2 Fixes: Database update for file_library, failure during deactivate 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 | 2 ++ setup/databaseScripts/create_database_V1.1.33.sql | 2 +- setup/databaseScripts/update_database_V1.1.33.sql | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/deactivate.php b/deactivate.php index 352e8f06..2ced0ebd 100644 --- a/deactivate.php +++ b/deactivate.php @@ -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()) { diff --git a/setup/databaseScripts/create_database_V1.1.33.sql b/setup/databaseScripts/create_database_V1.1.33.sql index 1fd8d26d..5844b472 100644 --- a/setup/databaseScripts/create_database_V1.1.33.sql +++ b/setup/databaseScripts/create_database_V1.1.33.sql @@ -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)) diff --git a/setup/databaseScripts/update_database_V1.1.33.sql b/setup/databaseScripts/update_database_V1.1.33.sql index d17d8fef..7ae901f4 100644 --- a/setup/databaseScripts/update_database_V1.1.33.sql +++ b/setup/databaseScripts/update_database_V1.1.33.sql @@ -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)) -- 2.17.1