From: Matthew Wire Date: Sun, 20 Mar 2022 20:53:20 +0000 (+0000) Subject: Fix undefined index by making sure that is_template is always defined X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=aca8f88cb844a58b0148cbee7b448d3614617673;p=civicrm-core.git Fix undefined index by making sure that is_template is always defined --- diff --git a/CRM/Contribute/Form/Contribution.php b/CRM/Contribute/Form/Contribution.php index 7a58a71eb2..694b6b346c 100644 --- a/CRM/Contribute/Form/Contribution.php +++ b/CRM/Contribute/Form/Contribution.php @@ -280,16 +280,16 @@ class CRM_Contribute_Form_Contribution extends CRM_Contribute_Form_AbstractEditP $this->assignPremiumProduct($this->_id); $this->buildValuesAndAssignOnline_Note_Type($this->_id, $this->_values); } + if (!isset($this->_values['is_template'])) { + $this->_values['is_template'] = FALSE; + } + $this->assign('is_template', $this->_values['is_template']); // when custom data is included in this page if (!empty($_POST['hidden_custom'])) { $this->applyCustomData('Contribution', $this->getFinancialTypeID(), $this->_id); } - if (!empty($this->_values['is_template'])) { - $this->assign('is_template', TRUE); - } - $this->_lineItems = []; if ($this->_id) { if (!empty($this->_compId) && $this->_compContext === 'participant') {