From: Chuck Scott Date: Wed, 2 Sep 2015 20:31:22 +0000 (-0400) Subject: Temp fix for install problems with wrong number of tables and new settings tables. X-Git-Tag: v1.0.3^2 X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/?a=commitdiff_plain;h=29924138eef50986ed1a07eff75267b3588e822a;p=WP-Plugins%2Fglm-member-db.git Temp fix for install problems with wrong number of tables and new settings tables. --- diff --git a/activate.php b/activate.php index 8320e216..7897ed62 100644 --- a/activate.php +++ b/activate.php @@ -42,7 +42,7 @@ class glmMembersPluginActivate extends glmPluginSupport * @access private */ public $dbVersions = array( - '0.1' => array('version' => '0.1', 'tables' => 24) + '0.1' => array('version' => '0.1', 'tables' => 26) ); /** @@ -178,7 +178,7 @@ class glmMembersPluginActivate extends glmPluginSupport // Check if the database version set for this plugin is invalid. if (!isset($this->dbVersions[$dbVersion])) { - $this->addNotice("The last database version set for the ".GLM_MEMBERS_PLUGIN_NAME." (V$dbVersion) isn't valid."); + update_option('glmMembersInstallErrors', "The last database version set for the ".GLM_MEMBERS_PLUGIN_NAME." (V$dbVersion) isn't valid."); return false; } @@ -198,8 +198,9 @@ class glmMembersPluginActivate extends glmPluginSupport // Otherwise check if the number of tables is correct } elseif ($tables != $existingTables) { - $this->addNotice('We do not have the correct number of tables for the currently set database version (V'.$dbVersion.') for the '.GLM_MEMBERS_PLUGIN_NAME.'.'); - $this->addNotice("There should be $tables but there are currently $existingTables. Please call for support."); + update_option('glmMembersInstallErrors', 'We do not have the correct number of tables for the currently set database version (V'.$dbVersion.') for the '.GLM_MEMBERS_PLUGIN_NAME.'.' + ."
There should be $tables but there are currently $existingTables. Please call for support." + ); return false; } @@ -232,7 +233,7 @@ class glmMembersPluginActivate extends glmPluginSupport if (trim($queryError) == '') { // Notify the user that the database has been installed - $this->addNotice('New database tables installed for the '.GLM_MEMBERS_PLUGIN_NAME.' plugin.'); + update_option('glmMembersInstallErrors', 'New database tables installed for the '.GLM_MEMBERS_PLUGIN_NAME.' plugin.'); // Save the version of the installed database update_option('glmMembersDatabaseDbVersion', $dbVersion); @@ -241,9 +242,10 @@ class glmMembersPluginActivate extends glmPluginSupport $db_setup_status = true; } else { - $this->addNotice('Failure installing database tables for the '.GLM_MEMBERS_PLUGIN_NAME.' plugin.'); - $this->addNotice('Database Installation Error: '.print_r($queryError,1), 'Alert'); - $this->addNotice($q, 'DataBlock', 'Database Installation Query'); + update_option('glmMembersInstallErrors', 'Failure installing database tables for the '.GLM_MEMBERS_PLUGIN_NAME + .'
Database Installation Error: '.print_r($queryError,1) + .'
'.$q.'
' + ); } // Otherwise, check if we need to update the database diff --git a/classes/glmPluginSupport.php b/classes/glmPluginSupport.php index 43b1775c..a22755ce 100644 --- a/classes/glmPluginSupport.php +++ b/classes/glmPluginSupport.php @@ -127,7 +127,8 @@ class GlmPluginSupport // Otherwise, there must have been some other error. } else { - echo 'There has been an unknown error installing the Gaslight Media Members Database plugin.'; + $installErrors = get_option('glmMembersInstallErrors'); + echo 'There has been an unknown error installing the Gaslight Media Members Database plugin.

'.$installErrors; } diff --git a/models/admin/settings/index.php b/models/admin/settings/index.php index e0bb79d5..e9244c6f 100644 --- a/models/admin/settings/index.php +++ b/models/admin/settings/index.php @@ -144,7 +144,7 @@ class GlmMembersAdmin_settings_index extends GlmDataSettingsGeneral if (GLM_MEMBERS_PLUGIN_ADMIN_DEBUG) { glmMembersAdmin::addNotice("  /modesl/admin/settings/index.php: Unable to load General Settings.", 'Alert'); } - +/* return array( 'status' => false, 'menuItemRedirect' => 'error', @@ -154,6 +154,7 @@ class GlmMembersAdmin_settings_index extends GlmDataSettingsGeneral 'reason' => 'Unable to create general settings entry in database.' ) ); +*/ } break;