Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CRM-19545 Custom field groups missing from views #405

Open
wants to merge 1 commit into
base: 7.x-master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion modules/views/components/civicrm.core.inc
Original file line number Diff line number Diff line change
Expand Up @@ -2911,7 +2911,7 @@ function _civicrm_core_data(&$data, $enabled) {

while ($dao->fetch()) {
// 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));
$extendsContactSubtype = (in_array($dao->extends, array('Contact', 'Individual', 'Organization', 'Household')) && !empty($dao->extends_entity_column_value));
Copy link
Member

@monishdeb monishdeb Nov 4, 2016

Choose a reason for hiding this comment

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

You can use CRM_Contact_BAO_ContactType::basicTypePairs() instead, which will consider user-defined contact types and sub-types too.

Copy link
Contributor

Choose a reason for hiding this comment

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

The patch, and this proposed alteration does not fix the issue for custom fields assigned to Relationships. I'll take a look at an alternative solution.

Copy link
Contributor

Choose a reason for hiding this comment

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

I've updated the issue in JIRA with some additional comments.

$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);
Expand Down