Fixes notices by moving the assign out of the function that adds the form elements
This one only matters when smarty is in secure mode:
$this->addPaymentProcessorFieldsToForm();
$this->assign('is_pay_later', $this->getCurrentPaymentProcessor() === 0 && $this->_values['is_pay_later']);
$this->assign('pay_later_text', $this->getCurrentPaymentProcessor() === 0 ? $this->getPayLaterLabel() : NULL);
-
+ $this->assign('nocid', $contactID === 0);
if ($contactID === 0) {
$this->addCidZeroOptions();
-
}
//build pledge block.
* and a dozen other small ones to be refactored into a shared parent with the reduction of much code duplication
*/
public function addCIDZeroOptions() {
- $this->assign('nocid', TRUE);
$profiles = [];
if ($this->_values['custom_pre_id']) {
$profiles[] = $this->_values['custom_pre_id'];
$this->addPaymentProcessorFieldsToForm();
}
}
-
- if ($contactID === 0 && !$this->_values['event']['is_multiple_registrations']) {
+ $isSelectContactID = ($contactID === 0 && !$this->_values['event']['is_multiple_registrations']);
+ $this->assign('nocid', $isSelectContactID);
+ if ($isSelectContactID) {
//@todo we are blocking for multiple registrations because we haven't tested
$this->addCIDZeroOptions();
}
</fieldset>
{include file="CRM/common/customDataBlock.tpl"}
-
<div class="crm-submit-buttons">{include file="CRM/common/formButtons.tpl" location="bottom"}</div>
{/if}
<div class="spacer"></div>
-{if !empty($nocid)}
+{if $nocid}
<div class="crm-other-contact-row messages status">
<span>{ts}You are completing this form on behalf of someone else. Please enter their details.</span>{/ts}
{if !empty($selectable)}