From 39f1151bcc7bd38dc128915204da9d8131f72650 Mon Sep 17 00:00:00 2001 From: Steve Sutton Date: Sat, 17 Mar 2018 14:55:08 -0400 Subject: [PATCH] Update for getting settings make sure the db version is set before getting any setting or management --- index.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/index.php b/index.php index 14ac901..932b64b 100644 --- a/index.php +++ b/index.php @@ -145,11 +145,13 @@ if (is_file(GLM_MEMBERS_BILLING_PLUGIN_DB_SCRIPTS.'/dbVersions.php')) { // Load Add-On Management Settings data /* None - Need to figure out a smooth way to do this. */ -$glmMembersBillingSettings = $wpdb->get_row( "SELECT * FROM ".GLM_MEMBERS_BILLING_PLUGIN_DB_PREFIX."settings WHERE id = 1", ARRAY_A ); -unset($glmMembersBillingSettings['id']); +if ( $glmMembersDatabasePluginVersion ) { + $glmMembersBillingSettings = $wpdb->get_row( "SELECT * FROM ".GLM_MEMBERS_BILLING_PLUGIN_DB_PREFIX."settings WHERE id = 1", ARRAY_A ); + unset($glmMembersBillingSettings['id']); -$glmMembersBillingManagement = $wpdb->get_row( "SELECT * FROM ".GLM_MEMBERS_BILLING_PLUGIN_DB_PREFIX."management WHERE id = 1", ARRAY_A ); -unset($glmMembersBillingManagement['id']); + $glmMembersBillingManagement = $wpdb->get_row( "SELECT * FROM ".GLM_MEMBERS_BILLING_PLUGIN_DB_PREFIX."management WHERE id = 1", ARRAY_A ); + unset($glmMembersBillingManagement['id']); +} function glmMembersBillingRegisterAddOn($addOns) { -- 2.17.1