Temp fix for install problems with wrong number of tables and new settings tables.
authorChuck Scott <cscott@gaslightmedia.com>
Wed, 2 Sep 2015 20:31:22 +0000 (16:31 -0400)
committerChuck Scott <cscott@gaslightmedia.com>
Wed, 2 Sep 2015 20:31:22 +0000 (16:31 -0400)
activate.php
classes/glmPluginSupport.php
models/admin/settings/index.php

index 8320e21..7897ed6 100644 (file)
@@ -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.'.'
+                    ."<br>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('<b>Database Installation Error:</b> '.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
+                    .'<br><b>Database Installation Error:</b> '.print_r($queryError,1)
+                    .'<br><pre>'.$q.'</pre>'
+                );
             }
 
         // Otherwise, check if we need to update the database
index 43b1775..a22755c 100644 (file)
@@ -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.<p>'.$installErrors;
 
             }
 
index e0bb79d..e9244c6 100644 (file)
@@ -144,7 +144,7 @@ class GlmMembersAdmin_settings_index extends GlmDataSettingsGeneral
                     if (GLM_MEMBERS_PLUGIN_ADMIN_DEBUG) {
                         glmMembersAdmin::addNotice("<b>&nbsp;&nbsp;/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;