Fix preData custom field collection on CiviCRM 5.67+
This is an update to !222 (merged) - this function has moved in Civi 5.67.
Ideally we wouldn't be calling a function that isn't exposed to begin with - and perhaps we should have copied that function into CiviRules. The longer-term solution is to use APIv4 here. This function moved because APIv4 now has pseudo-entities for "Individual", "Organization", and "Household" - if we used APIv4 here we could take advantage of that. However, that would likely require switching to APIv4 across most or all of CiviRules.
Merge request reports
Activity
Replication Steps:
- Create a custom field group that extends Individuals.
- Create a CiviRule that triggers when any contact is edited.
- Add a "Field Value Comparison" condition, checking off the box to compare the value from before the edit.
- Edit a field in the custom field group.
When the rule is fired, it will try to pick up custom data using "Individual" as the entity rather than "Contact".
mentioned in commit 64e19d77
Thanks @JonGold
With 5.67 released, it would probably be good to get a version of CiviRules with this patch released, also.
With CiviRules 2.50, I ended up having a fatal error on WordPress when doing a test contribution for processing a membership renewal. Here was the main error:
Fatal error: Uncaught Error: Call to undefined method Civi\Api4\Service\Schema\Joinable\CustomGroupJoinable::getEntityFromExtends() in /…/public_html/wp-content/uploads/civicrm/ext/org.civicoop.civirules/CRM/Civirules/Utils/PreData.php on line 106
This merged PR fixes the issue.
Just hit this nasty one a few times - fatal error 500. Thanks for the fix.
Edited by justinfreeman (Agileware)