if ( !isset( $_REQUEST['glm_custom_field'] ) ) {
return false;
}
+ //echo "Trying to save entity of type $uid";
// See if this memberInfo has current field data
$currentCustomFields = customFieldsGetFields( $memberId );
if (isset($_REQUEST['id'])) {
$id = $_REQUEST['id']-0;
}
+ $uid = 0;
+
+ if (isset($actionData['uid'])) {
+ $uid = $actionData['uid'];
+ }
switch ($option) {
// Get list of Custom Fields
$custom_fields = $this->getList();
+ // echo "<pre>" . print_r($custom_fields, true) . "</pre>";
if ( isset($custom_fields) && $custom_fields && count( $custom_fields ) > 0 ) {
$haveCustomFields = true;
}
'custom_fields' => $custom_fields,
'field_types' => $this->config['custom_field_types'],
'haveCustomFields' => $haveCustomFields,
+ 'uid' => $uid
);
// Return status, suggested view, and data to controller
*/
add_filter( 'glm-members-custom-fields-form', function( $content, $uid, $id ){
unset( $_REQUEST['glm_action'] );
- // $content = $this->controller( 'entity', 'fields', array( 'uid' => false, 'memberId' => false ), true );
- $content = $this->controller( 'entity', 'fields', array('uid'=>$uid, "memberId"=>$id), true );
+ $content = $this->controller( 'entity', 'fields', array( 'uid' => $uid, 'memberId' => $id ), true );
return $content;
}, 10, 3 );
/**
}
return $queryParts;
});
-add_action(
- 'glm-member-db-save-custom-fields',
- function( $memberInfoId ){
- require_once GLM_MEMBERS_FIELDS_PLUGIN_CLASS_PATH . '/customFieldPluginSupport.php';
- // this will save the member data
- customFieldsSaveFields( $memberInfoId );
+add_filter('glm-member-db-save-custom-fields', function( $entityId ) {
+ require_once GLM_MEMBERS_FIELDS_PLUGIN_CLASS_PATH . '/customFieldPluginSupport.php';
+ // this will save the member data
+ //echo "uid = $uid";
+ customFieldsSaveFields( $entityId );
+ return true;
},
- 1,
+ 10,
1
);
add_action(
<input type="checkbox" name="required" value="1" />
</td>
</tr>
+ <input type="hidden" name="uid" value="{$uid}">
</table>
<p><span class="glm-required">*</span> Required</p>
<a id="newFieldCancel" class="button button-primary glm-right">Cancel</a>
<th>ID</th>
<th>Field</th>
<th>Type</th>
+ <th>UID/Entity</th>
+ <th>Required</th>
+ <th>Admin Searchable</th>
<th> </th>
</tr>
</thead>
<td id="editFieldType_{$t.id}">
{$t.field_type.name}
</td>
+ <td>
+ {$t.uid}
+ </td>
+ <td>
+ {$t.required.name}
+ </td>
+ <td>
+ {$t.admin_search.name}
+ </td>
<td>
<div class="deleteFieldButton button button-secondary glm-button-small glm-right" data-fieldID="{$t.id}">Delete</div>
</td>