Details
-
Type: Bug
-
Status: Done/Fixed
-
Priority: Minor
-
Resolution: Fixed/Completed
-
Affects Version/s: 4.1.2, 4.4.6, 4.5
-
Component/s: CiviCRM API
-
Labels:
-
Documentation Required?:None
Description
Steps to reproduce:
1. Create a Custom field for Memberships of type MEMBERSHIP_TYPE_ID and set the 'View only' checkbox. (in my case, it is an integer field.)
2. Run this PHP API code.
$results = civicrm_api("Membership","create", array ('version' => 3,
'contact_id' => $contact_id,
'membership_type_id' => MEMBERSHIP_TYPE_ID,
'status_id' => 1,
'custom_'. CUSTOM_FIELD_ID => 123,
)
);
Expected Results: The value '123' is saved to the custom field, because the 'View only' help text states that the features is intended to allow for values that are set by PHP.
Actual results: The value is not set.
Work-around: The value is set correctly if the 'View only' checkbox is unchecked for the custom field.