From: Steve Sutton Date: Mon, 3 Apr 2017 16:23:24 +0000 (-0400) Subject: Fix error from profile index X-Git-Tag: v1.0.23^2~7 X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/?a=commitdiff_plain;h=d22e21a9540e9796286f5933daa1ccacc2e3d7fc;p=WP-Plugins%2Fglm-member-db-contacts.git 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. --- 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 +?>