Custom Groups should not exclude activity types where filter > 0 if in managed entities
Overview
CRM_Core_BAO_CustomGroup::getSubTypes() excludes all subtypes where filter is not zero. This is a problem for managed entities where an activity type is defined with filter = 1
for example.
It uses this deprecated function $activityType = CRM_Core_PseudoConstant::activityType(FALSE, TRUE, FALSE, 'label', TRUE);
https://chat.civicrm.org/civicrm/pl/oy16q7rrgbrppqyi69dw6a5waa
Reproduction steps
- Put an activity type into a managed entity; make sure 'filter' => 1.
- Then create a custom group and have it extend that activity type.
- Put that custom group in a managed entity.
- Delete the manually made activity type and custom group so they'll properly be created with managed entity.
- Now run flush and reconciling the managed entities fails: get error: "Supplied Sub type is not valid for the specified entitiy"
Current behaviour
Managed entity reconciliation fails with error: "Supplied Sub type is not valid for the specified entitiy"
Expected behaviour
Should run.
Environment information
- CiviCRM: 5.52.x
- PHP: 7.4
- CMS: Drupal 9.4.x