Skip to content
Snippets Groups Projects

Fix preData custom field collection on CiviCRM 5.67+

Merged JonGold requested to merge JonGold/civirules:predata-fix-567 into master

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

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • Author Maintainer

    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".

  • jaapjansma mentioned in commit 64e19d77

    mentioned in commit 64e19d77

  • merged

  • 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.

  • I have made a new release 2.51

  • Just hit this nasty one a few times - fatal error 500. Thanks for the fix.

    Edited by justinfreeman (Agileware)
Please register or sign in to reply
Loading