Skip to content
Snippets Groups Projects
Unverified Commit 8d0350de authored by Eileen McNaughton's avatar Eileen McNaughton Committed by GitHub
Browse files

Merge pull request #14244 from greenpeace-cee/fix-contribution-overwrite

financial#50 - Fix contributions and participants getting overwritten
parents a541c4f3 5774b54f
Branches
Tags
No related merge requests found
......@@ -250,7 +250,7 @@ class CRM_Contribute_Form_Contribution extends CRM_Contribute_Form_AbstractEditP
$this->assign('action', $this->_action);
// Get the contribution id if update
$this->_id = CRM_Utils_Request::retrieve('id', 'Positive', $this);
$this->_id = CRM_Utils_Request::retrieve('id', 'Positive');
if (!empty($this->_id)) {
$this->assignPaymentInfoBlock();
$this->assign('contribID', $this->_id);
......@@ -466,6 +466,10 @@ class CRM_Contribute_Form_Contribution extends CRM_Contribute_Form_AbstractEditP
* Build the form object.
*/
public function buildQuickForm() {
if ($this->_id) {
$this->add('hidden', 'id', $this->_id);
}
if ($this->_action & CRM_Core_Action::DELETE) {
$this->addButtons([
[
......
......@@ -258,7 +258,7 @@ class CRM_Event_Form_Participant extends CRM_Contribute_Form_AbstractEditPayment
$this->_id = NULL;
}
else {
$this->_id = CRM_Utils_Request::retrieve('id', 'Positive', $this);
$this->_id = CRM_Utils_Request::retrieve('id', 'Positive');
}
if ($this->_id) {
......@@ -594,6 +594,10 @@ class CRM_Event_Form_Participant extends CRM_Contribute_Form_AbstractEditPayment
* @throws \CiviCRM_API3_Exception
*/
public function buildQuickForm() {
if ($this->_id) {
$this->add('hidden', 'id', $this->_id);
}
$participantStatuses = CRM_Event_PseudoConstant::participantStatus();
$partiallyPaidStatusId = array_search('Partially paid', $participantStatuses);
$this->assign('partiallyPaidStatusId', $partiallyPaidStatusId);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment