fix: "in_array() expects parameter 2 to be array, null given"

This commit is contained in:
Marc Michalsky 2024-06-12 10:55:52 +02:00
parent f5ab576ed9
commit cf9483ca3e
Signed by untrusted user who does not match committer: marc.koch
GPG key ID: 12406554CFB028B9

View file

@ -807,7 +807,7 @@ function civicrm_api3_twingle_donation_Submit($params) {
} }
// Add notes to the contribution. // Add notes to the contribution.
$contribution_note_mappings = $profile->getAttribute("map_as_contribution_notes"); $contribution_note_mappings = $profile->getAttribute("map_as_contribution_notes", []);
foreach (['purpose', 'remarks'] as $target) { foreach (['purpose', 'remarks'] as $target) {
if ( if (
in_array($target, $contribution_note_mappings) in_array($target, $contribution_note_mappings)