'price_' . $field['id'],
$field['id'],
FALSE,
- CRM_Utils_Array::value('is_required', $field, FALSE),
+ $field['is_required'] ?? FALSE,
NULL,
$options
);
}
}
if (!empty($options)) {
+ $label = (!empty($this->_membershipBlock) && $field['name'] === 'contribution_amount') ? ts('Additional Contribution') : $field['label'];
CRM_Price_BAO_PriceField::addQuickFormElement($form,
'price_' . $field['id'],
$field['id'],
FALSE,
- CRM_Utils_Array::value('is_required', $field, FALSE),
- NULL,
+ $field['is_required'] ?? FALSE,
+ $label,
$options
);
}
/* FIXME: failure! */
return NULL;
}
-
+ $label = $label ?: $field['label'];
$is_pay_later = 0;
$isQuickConfig = CRM_Price_BAO_PriceSet::isQuickConfig($field->price_set_id);
if (isset($qf->_mode) && empty($qf->_mode)) {
// get currency name for price field and option attributes
$currencyName = $config->defaultCurrency;
- if (!isset($label)) {
- $label = (!empty($qf->_membershipBlock) && $field->name === 'contribution_amount') ? ts('Additional Contribution') : $field->label;
- }
-
if (isset($qf->_online) && $qf->_online) {
$useRequired = FALSE;
}