compucorp / uk.co.compucorp.civicrm.pivotreport

CiviCRM Pivot table reporting solution
Other
8 stars 13 forks source link

GS-43: Supported entities validation #71

Closed coldrunKacper closed 6 years ago

coldrunKacper commented 6 years ago

On HW local site there was an error during caching Contribution entity. It was caused because CiviContribute component was disabled on the site. To fix this issue I've extended entities validation to check for API response on required entities.

Now we can define 'extensions' and 'entities' array values as requirements for any supported entity in CRM_PivotReport_Entity class. It allows to check these requirements before adding the entity to supported entities list.

For example: $entities = array( 'Prospect' => array( 'extensions' => array( 'uk.co.compucorp.civicrm.prospect', ), 'entities' => array( 'Contribution', 'Pledge', ), );

Additionally, each entity is validated with API call to the entity itself (even if we don't specify required entities).

For example: $entities = array( 'Contribution' => array() );