systopia / de.systopia.remoteevent

CiviCRM Extension for remote event features
Other
0 stars 1 forks source link

Retrieve contact custom field default values with APIv4 but retain legacy field names (`custom_x`) #76

Closed jensschuppe closed 6 months ago

jensschuppe commented 6 months ago

Default values for custom fields on contacts are currently being retrieved with API3 Contact.getsingle which requires the "old" custom field names (custom_x), while the mapping is not being updated and still uses CustomGroupName.CustomFieldName.

This causes default values for custom fields not being retrieved when calling RemoteParticipant.get_form.

This should eventually only use API4 without the old notation, but I'm not sure if anything might depend on it and thus kept both. Not the most beautiful fix, but does the job for now …

@dontub Feel free to adjust if you find the time (which I don't).

Note: This will have to be merged for 1.3 in the current master branch, and cherry-pciked for 1.2 (currently in beta).

systopia-reference: 24954

dontub commented 6 months ago

The APIv3 call might be kept for backward compatibility. Though I haven't seen any extension depending on the custom field values in the APIv3 notation...

When do we want to remove the APIv3 call?

jensschuppe commented 6 months ago

When do we want to remove the APIv3 call?

I filed a follow-up for the next major version: #77

dontub commented 6 months ago

I'd suggest to also add a comment to the code. Otherwise I'm fine with it.