Skip to content

Commit

Permalink
Fix missing default value for event registration setup
Browse files Browse the repository at this point in the history
  • Loading branch information
larssandergreen committed Jan 24, 2023
1 parent 039f856 commit be1bdee
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions CRM/Event/Form/ManageEvent/Registration.php
Expand Up @@ -116,8 +116,7 @@ public function setDefaultValues() {
$defaults["custom_post_id_multiple[$key]"] = $value;
}
}

$this->assign('profilePostMultiple', CRM_Utils_Array::value('custom_post', $defaults));
$this->assign('profilePostMultiple', $defaults['custom_post'] ?? NULL);

// CRM-17745: Make max additional participants configurable
if (empty($defaults['max_additional_participants'])) {
Expand Down Expand Up @@ -149,7 +148,7 @@ public function setDefaultValues() {
$defaults["additional_custom_post_id_multiple[$key]"] = $value;
}
}
$this->assign('profilePostMultipleAdd', CRM_Utils_Array::value('additional_custom_post', $defaults, []));
$this->assign('profilePostMultipleAdd', $defaults['additional_custom_post'] ?? []);
}
else {
// Avoid PHP notices in the template
Expand All @@ -161,10 +160,10 @@ public function setDefaultValues() {
}

// provide defaults for required fields if empty (and as a 'hint' for approval message field)
$defaults['registration_link_text'] = CRM_Utils_Array::value('registration_link_text', $defaults, ts('Register Now'));
$defaults['confirm_title'] = CRM_Utils_Array::value('confirm_title', $defaults, ts('Confirm Your Registration Information'));
$defaults['thankyou_title'] = CRM_Utils_Array::value('thankyou_title', $defaults, ts('Thank You for Registering'));
$defaults['approval_req_text'] = CRM_Utils_Array::value('approval_req_text', $defaults, ts('Participation in this event requires approval. Submit your registration request here. Once approved, you will receive an email with a link to a web page where you can complete the registration process.'));
$defaults['registration_link_text'] ??= ts('Register Now');
$defaults['confirm_title'] ??= ts('Confirm Your Registration Information');
$defaults['thankyou_title'] ??= ts('Thank You for Registering');
$defaults['approval_req_text'] ??= ts('Participation in this event requires approval. Submit your registration request here. Once approved, you will receive an email with a link to a web page where you can complete the registration process.');

return $defaults;
}
Expand Down

0 comments on commit be1bdee

Please sign in to comment.