From 3db2d5ef80fb876c917feeec4fc834b2a7e19e36 Mon Sep 17 00:00:00 2001 From: Jitendra Purohit Date: Wed, 10 Jan 2018 15:37:28 +0530 Subject: [PATCH] CRM-21647 - Fatal error on deleting any contribution record --- CRM/Contribute/Form/Contribution.php | 34 ++++++++++++++-------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/CRM/Contribute/Form/Contribution.php b/CRM/Contribute/Form/Contribution.php index a9c18b80c4..52ffaeddd8 100644 --- a/CRM/Contribute/Form/Contribution.php +++ b/CRM/Contribute/Form/Contribution.php @@ -450,6 +450,23 @@ class CRM_Contribute_Form_Contribution extends CRM_Contribute_Form_AbstractEditP * Build the form object. */ public function buildQuickForm() { + if ($this->_action & CRM_Core_Action::DELETE) { + $this->addButtons(array( + array( + 'type' => 'next', + 'name' => ts('Delete'), + 'spacing' => '         ', + 'isDefault' => TRUE, + ), + array( + 'type' => 'cancel', + 'name' => ts('Cancel'), + ), + ) + ); + return; + } + // FIXME: This probably needs to be done in preprocess if (CRM_Financial_BAO_FinancialType::isACLFinancialTypeStatus() && $this->_action & CRM_Core_Action::UPDATE @@ -582,23 +599,6 @@ class CRM_Contribute_Form_Contribution extends CRM_Contribute_Form_AbstractEditP $this->applyFilter('__ALL__', 'trim'); - if ($this->_action & CRM_Core_Action::DELETE) { - $this->addButtons(array( - array( - 'type' => 'next', - 'name' => ts('Delete'), - 'spacing' => '         ', - 'isDefault' => TRUE, - ), - array( - 'type' => 'cancel', - 'name' => ts('Cancel'), - ), - ) - ); - return; - } - //need to assign custom data type and subtype to the template $this->assign('customDataType', 'Contribution'); $this->assign('customDataSubType', $this->_contributionType); -- 2.25.1