Remove use of nullArray in delete hooks
authoreileen <emcnaughton@wikimedia.org>
Fri, 27 Nov 2020 07:05:06 +0000 (20:05 +1300)
committereileen <emcnaughton@wikimedia.org>
Fri, 27 Nov 2020 07:05:06 +0000 (20:05 +1300)
commitbe12df5ab37429c6f227ead9297bcd551fbaa645
tree36baa7195ea6ca9ad53c6a20ddaf3074520eb3f8
parent9219cf5f72fd1029d0c0f966b4fa75deda7e06fb
Remove use of nullArray in delete hooks

Looking at #18995 I was struck by the delete hook being non-standard. In general we don't load from the DB just to pass
to the hook as the hook can do that itself. However, when I looked at other hooks
I found that they were passing out nullArray - this is a legacy method that precedes
being on a php version that supported default params when passing by reference.

It's further known to introduce intermittent hard to debug issues. This adds the new hook
and also adds standardisation to the other hooks for pre+delete.

I've left the create one for now but GroupContact is a good example of something
close to what we want to standardise on there
19 files changed:
CRM/Batch/BAO/Batch.php
CRM/Campaign/BAO/Campaign.php
CRM/Case/BAO/Case.php
CRM/Contact/BAO/Contact.php
CRM/Contact/BAO/Group.php
CRM/Contact/BAO/Relationship.php
CRM/Contribute/BAO/Contribution.php
CRM/Core/BAO/UFGroup.php
CRM/Event/BAO/Event.php
CRM/Event/BAO/Participant.php
CRM/Grant/BAO/Grant.php
CRM/Mailing/BAO/Mailing.php
CRM/Mailing/BAO/MailingAB.php
CRM/Mailing/BAO/MailingJob.php
CRM/PCP/BAO/PCP.php
CRM/Pledge/BAO/Pledge.php
CRM/Pledge/BAO/PledgeBlock.php
CRM/Utils/Hook.php
Civi/Api4/Generic/Traits/CustomValueActionTrait.php