$customRow[0]
)
);
+ // 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
+ )
+ );
// get the active member info id
- $memberInfoId =
- $memberInfoData->getActiveInfoIdForMember( $memberId );
+ // $memberInfoId =
+ // $memberInfoData->getActiveInfoIdForMember( $memberId );
$customFieldId = $this->wpdb->get_var(
$this->wpdb->prepare(
"SELECT id
$customRow[1]
)
);
- if ( $customFieldId ) {
+ if ( $customFieldId && $memberContactId ) {
$newId = $this->wpdb->insert(
GLM_MEMBERS_FIELDS_PLUGIN_DB_PREFIX . 'custom_field_data',
array(
- 'entity_id' => $memberInfoId,
+ 'entity_id' => $memberContactId,
'field_id' => $customFieldId,
'field_data' => $customRow[2],
),