From d22e21a9540e9796286f5933daa1ccacc2e3d7fc Mon Sep 17 00:00:00 2001 From: Steve Sutton Date: Mon, 3 Apr 2017 12:23:24 -0400 Subject: [PATCH] Fix error from profile index Getting an error when get_user_meta doesn't return anything. Checking for $contactMemberList first before trying to add it to the query. --- models/admin/profile/index.php | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/models/admin/profile/index.php b/models/admin/profile/index.php index 24e6258..cef0d9e 100644 --- a/models/admin/profile/index.php +++ b/models/admin/profile/index.php @@ -289,13 +289,15 @@ class GlmMembersAdmin_profile_index extends GlmDataContacts // Get contact's list of members they can manage $contactMembersList = get_user_meta($this->wpUserID, 'glmMembersContactMembers', true); + if ( $contactMembersList ) { - // Get a list of contact members with names and other basic info from the list of ids - $contactMembers = $this->Members->getIdName("ID in (".$contactMembersList.")"); + // Get a list of contact members with names and other basic info from the list of ids + $contactMembers = $this->Members->getIdName("ID in (".$contactMembersList.")"); - // Generate MD5 check string for each member ID - foreach ($contactMembers as $key => $value) { - $contactMembers[$key]['idCheck'] = md5(GLM_MEMBERS_CONTACTS_MD5_SECRET.$value['id']); + // Generate MD5 check string for each member ID + foreach ($contactMembers as $key => $value) { + $contactMembers[$key]['idCheck'] = md5(GLM_MEMBERS_CONTACTS_MD5_SECRET.$value['id']); + } } } @@ -316,4 +318,4 @@ class GlmMembersAdmin_profile_index extends GlmDataContacts } } -?> \ No newline at end of file +?> -- 2.17.1