Skip to content

Commit

Permalink
Updated call to civicrm_views_custom_data_cache as per CRM-18776 (#386)
Browse files Browse the repository at this point in the history
* Updated call to civicrm_views_custom_data_cache as per CRM-18776

* More readable version, thanks GinkoFJG
  • Loading branch information
adixon authored and colemanw committed Oct 12, 2016
1 parent 71ef497 commit e9eca96
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions modules/views/components/civicrm.core.inc
Original file line number Diff line number Diff line change
Expand Up @@ -2910,9 +2910,11 @@ function _civicrm_core_data(&$data, $enabled) {


while ($dao->fetch()) {
// call getTree using $dao->id as groupID and $dao->extends as entityType

$data = civicrm_views_custom_data_cache($data, $dao->extends, $dao->id, $dao->extends_entity_column_value);
// call getTree using $dao->id as groupID, $dao->extends as entityType, with possible subtypes in $dao->extends_entity_column_value
$extendsContactSubtype = (('Contact' === $dao->extends) && !empty($dao->extends_entity_column_value));
$contactSubtypes = !$extendsContactSubtype ? NULL : array_filter(explode(CRM_Core_DAO::VALUE_SEPARATOR, $dao->extends_entity_column_value));
$contactSubtypes = empty($contactSubtypes) ? NULL : $contactSubtypes;
$data = civicrm_views_custom_data_cache($data, $dao->extends, $dao->id, $contactSubtypes);
}
}

3 comments on commit e9eca96

@JohnFF
Copy link
Contributor

@JohnFF JohnFF commented on e9eca96 Feb 1, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@adixon including this change breaks my views and prevents a Custom Field appearing in the Views UI drop down list.

@eileenmcnaughton
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JohnFF I think this is reverted in the latest code isn't it - although the revert will be in the 4.7.17 release at the start of March

@adixon
Copy link
Contributor Author

@adixon adixon commented on e9eca96 Feb 2, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The reverting PR is here:
#417

Please sign in to comment.