systopia / de.systopia.xcm

CiviCRM Extended Contact Matcher
Other
5 stars 10 forks source link

refactored implementation of action provider #55

Closed jaapjansma closed 4 years ago

jaapjansma commented 4 years ago

Before

When I exported a form processor with the XCM action on it and I mapped a custom field it was exported as custom_3. Where 3 is the ID of the field.

After

When I export the form processor with the XCM action on it and I mapped a custom field it is exported as custom_Individual_data_Matricule Where Indvidual_data is the name of the custom group and Matricule the name of the custom field. This way the configuration is consitent across all environments.

Remarks

This PR is backwards compatible. Meaning that existing form processors keeps working. However when you edit an existing action the mapping of the custom field seems lost so you have to set it again.

bjendres commented 4 years ago

@jaapjansma Doesn't this change mean, that XCM won't work anymore without the action provider extension?

jaapjansma commented 4 years ago

Not really. The functions changed are only used by the Action provided in this extension. Would it help if I move this functions into the same class?

bjendres commented 4 years ago

The functions changed are only used by the Action provided in this extension

I'm afraid that's not true. If I open the settings form in an environment where the action-provider is not installed, I get:

Error: Class 'Civi\ActionProvider\Parameter\Specification' not found in CRM_Xcm_Form_Settings::getContactFields() (line 570 of [...]/de.systopia.xcm/CRM/Xcm/Form/Settings.php).

That's because it's called in buildQuickForm().

jaapjansma commented 4 years ago

Thanks. I thought I searched for it but wrongly. I will change the PR so it still works even when the action provider is not installed.

jaapjansma commented 4 years ago

I have changed the PR so it keeps working without the action provider installed.

bjendres commented 4 years ago

@jaapjansma Are you done here, can I merge? It seems to work now w/o action provider...

jaapjansma commented 4 years ago

Yes I am done and this could be merged

bjendres commented 4 years ago

Thanks @jaapjansma