CiviMRF / CMRF_Abstract_Core

Abstract implementation for the the CMRF Core. Should be included into the concrete module implementation
GNU Affero General Public License v3.0
1 stars 4 forks source link

Support Address validate API calls #23

Closed agileware-iris closed 4 months ago

agileware-iris commented 5 months ago

Address validation expects an Action and an action parameter.

$result = civicrm_api3('Address', 'validate', [
  'action' => "create",
  'contact_id' => $contact_id,
  'location_type_id' => $location_type_id,
]);

This allows 'action' key (API action) to be included in the $request for the validate Action.

Also fixes caching. API validation (and all other API calls) won't work correctly when the cache option is enabled, since the cached table returns results for API calls with the same request parameters, even if Entity and Action are different. This is because the request hash is being built ONLY using the request parameters.

Now Entity and Action are added back into the request hash.

agileware-iris commented 4 months ago

We've decided to take a different approach for Address validation. Don't need that bit anymore. Thanks!