Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for dev/membership#37 #20493

Merged
merged 1 commit into from
Jun 9, 2021

Conversation

jaapjansma
Copy link
Contributor

Overview

This fixes the issue that when you have membership with a contact reference custom field and the membership type is configured to be related that creating relationships fails.

See https://lab.civicrm.org/dev/membership/-/issues/37 for a more detailed report, including on how to reproduce.

Before

The membership was retrieved by the api which return values for contact reference fields as custom_xx = 'Joe' and custom_xx_id = 202.
Those values where passed to the Membership.create parameters.

After

Just before the values are passed to the Membership.create api the custom values are converted from custom_xx_id to custom_xx.

@civibot
Copy link

civibot bot commented Jun 3, 2021

(Standard links)

@colemanw
Copy link
Member

colemanw commented Jun 6, 2021

The code looks fine to me. It's unfortunate that this workaround is needed but APIv3 has these quirks.
Glad to see a unit test.

@nganivet
Copy link
Contributor

nganivet commented Jun 9, 2021

Code is fine, well commented and has unit test. No potential side effects. +1 for merging.

@eileenmcnaughton
Copy link
Contributor

Merging based on above review

@eileenmcnaughton eileenmcnaughton merged commit 53c7906 into civicrm:master Jun 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants