Skip to content

PHP 8 fix when contact doesn't exist

rajeshs requested to merge github/fork/MegaphoneJon/php8-fix into master

Created by: MegaphoneJon

When submitting "Update Comms Preferences" on a contact that doesn't currently exist, this error appears:

TypeError: array_fill_keys(): Argument #1 ($keys) must be of type array, string given in array_fill_keys() (line 523 of /mysite/web/sites/all/civicrm-custom/extensions/uk.co.vedaconsulting.gdpr/CRM/Gdpr/CommunicationsPreferences/Utils.php)

That's because of stricter PHP type checking in PHP8, this is a fix.

Merge request reports