From 647f257896c23ecd1aa0b89716a4be1a485aa65a Mon Sep 17 00:00:00 2001 From: Steve Sutton Date: Wed, 26 Apr 2017 17:04:45 -0400 Subject: [PATCH] Update the query to get the correct member type. Need to match member info id not the member info member field. --- index.php | 6 +++--- models/front/fields/detail.php | 4 ++-- models/front/fields/list.php | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/index.php b/index.php index a1a5c05..09bc185 100644 --- a/index.php +++ b/index.php @@ -3,7 +3,7 @@ * Plugin Name: GLM Members Database Custom Fields * Plugin URI: http://www.gaslightmedia.com/ * Description: Custom Field Add On - * Version: 1.0.1 + * Version: 1.0.2 * Author: Gaslight Media * Author URI: http://www.gaslightmedia.com/ * License: GPL2 @@ -19,7 +19,7 @@ * @package glmMembersFieldsAddOn * @author Chuck Scott * @license http://www.gaslightmedia.com Gaslightmedia - * @version 1.0.1 + * @version 1.0.2 */ /* @@ -37,7 +37,7 @@ * so that we're sure the other add-ons see an up to date * version from this plugin. */ -define('GLM_MEMBERS_FIELDS_PLUGIN_VERSION', '1.0.1'); +define('GLM_MEMBERS_FIELDS_PLUGIN_VERSION', '1.0.2'); define('GLM_MEMBERS_FIELDS_PLUGIN_DB_VERSION', '0.0.3'); // This is the minimum version of the GLM Members DB plugin require for this plugin. diff --git a/models/front/fields/detail.php b/models/front/fields/detail.php index e07438b..a7f26c8 100644 --- a/models/front/fields/detail.php +++ b/models/front/fields/detail.php @@ -64,7 +64,7 @@ class GlmMembersFront_fields_detail extends GlmDataFieldsCustomFields // print_r($member_info); $member_name = $member_info['member_name']; $member_name = urlencode($member_name); - + $where = "ref_dest = $member_info_id"; $fields_data = new GlmDataFieldsCustomFieldsData($this->wpdb, $this->config); @@ -74,7 +74,7 @@ class GlmMembersFront_fields_detail extends GlmDataFieldsCustomFields SELECT mt.name FROM " . GLM_MEMBERS_PLUGIN_DB_PREFIX . "member_type mt, " . GLM_MEMBERS_PLUGIN_DB_PREFIX . "members m, " . GLM_MEMBERS_PLUGIN_DB_PREFIX . "member_info mi - WHERE mi.member = $member_info_id + WHERE mi.id = $member_info_id AND m.id = mi.member AND mt.id = m.member_type"; $member_type = $wpdb->get_var($sql); diff --git a/models/front/fields/list.php b/models/front/fields/list.php index 4de0dcc..c394f2f 100644 --- a/models/front/fields/list.php +++ b/models/front/fields/list.php @@ -69,7 +69,7 @@ class GlmMembersFront_fields_list extends GlmDataFieldsCustomFields SELECT mt.name FROM " . GLM_MEMBERS_PLUGIN_DB_PREFIX . "member_type mt, " . GLM_MEMBERS_PLUGIN_DB_PREFIX . "members m, " . GLM_MEMBERS_PLUGIN_DB_PREFIX . "member_info mi - WHERE mi.member = $member_info_id + WHERE mi.id = $member_info_id AND m.id = mi.member AND mt.id = m.member_type"; $member_type = $wpdb->get_var($sql); -- 2.17.1