From b7b74eda2ac4b14678b136d4cd0df77832e4a5c2 Mon Sep 17 00:00:00 2001 From: Steve Sutton Date: Thu, 31 May 2018 08:40:16 -0400 Subject: [PATCH] Switch back to member info Will need this to be an import select (member or contact) --- models/admin/import/fields.php | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/models/admin/import/fields.php b/models/admin/import/fields.php index e27968c..ad9eb0c 100644 --- a/models/admin/import/fields.php +++ b/models/admin/import/fields.php @@ -238,18 +238,19 @@ class GlmMembersAdmin_import_fields extends GlmDataFieldsCustomFieldsData $customRow[0] ) ); + echo '
$memberId: ' . print_r( $memberId, true ) . '
'; // We need to get the contact id now - $memberContactId = $this->wpdb->get_var( - $this->wpdb->prepare( - "SELECT id - FROM " . GLM_MEMBERS_CONTACTS_PLUGIN_DB_PREFIX . "contacts - WHERE ref_dest = %d", - $memberId - ) - ); + // $memberContactId = $this->wpdb->get_var( + // $this->wpdb->prepare( + // "SELECT id + // FROM " . GLM_MEMBERS_CONTACTS_PLUGIN_DB_PREFIX . "contacts + // WHERE ref_dest = %d", + // $memberId + // ) + // ); // get the active member info id - // $memberInfoId = - // $memberInfoData->getActiveInfoIdForMember( $memberId ); + $memberInfoId = $memberInfoData->getActiveInfoIdForMember( $memberId ); + echo '
$memberInfoId: ' . print_r( $memberInfoId, true ) . '
'; $customFieldId = $this->wpdb->get_var( $this->wpdb->prepare( "SELECT id @@ -258,11 +259,12 @@ class GlmMembersAdmin_import_fields extends GlmDataFieldsCustomFieldsData $customRow[1] ) ); - if ( $customFieldId && $memberContactId ) { + echo '
$customFieldId: ' . print_r( $customFieldId, true ) . '
'; + if ( $customFieldId && $memberInfoId ) { $newId = $this->wpdb->insert( GLM_MEMBERS_FIELDS_PLUGIN_DB_PREFIX . 'custom_field_data', array( - 'entity_id' => $memberContactId, + 'entity_id' => $memberInfoId, 'field_id' => $customFieldId, 'field_data' => $customRow[2], ), -- 2.17.1