Creating a relationship fails when a related membership has a contact reference custom field.
How to reproduce?
- Create a new membership type. Set Relationship type to Employer of
- Create a custom field set for this membership type
- Add a custom field of type Contact Reference
- Create a new organization
- Add the membership and fill in a value at the custom field
- Now add a Employer of relationship between this organization and an Individual, press save
Relationship gets saved and a related membership is created with the correct value for the custom field
No relationship is created, no error is shown, the civicrm logo stays on the screen turning around. Also when refreshing the page an error popups with something: custom_xx is not a valid integer
When debuging this issue I disovered that a
Membership.get api is used. And those values are passed to a
Membership.create api call. The paramaters for the custom field have the format of
custom_xx = 'Joe' and
custom_xx_id = 202