*
* @return null|string
*/
- protected function updateRelatedComponent($contributionId, $statusId, $previousStatusId = NULL, $receiveDate = NULL) {
+ public static function updateRelatedComponent($contributionId, $statusId, $previousStatusId = NULL, $receiveDate = NULL) {
$statusMsg = NULL;
if (!$contributionId || !$statusId) {
return $statusMsg;
// process associated membership / participant, CRM-4395
if ($contribution->id && $action & CRM_Core_Action::UPDATE) {
- $this->statusMessage[] = $this->updateRelatedComponent($contribution->id,
+ $this->statusMessage[] = self::updateRelatedComponent($contribution->id,
$contribution->contribution_status_id,
CRM_Utils_Array::value('contribution_status_id',
$this->_values
unset($value['contribution_source']);
$contribution = CRM_Contribute_BAO_Contribution::add($value, $ids);
+ if (!empty($value['contribution_status_id'])) {
+ CRM_Contribute_Form_AbstractEditPayment::updateRelatedComponent($contribution->id,
+ $value['contribution_status_id'],
+ CRM_Utils_Array::value("field[{$key}][contribution_status_id]",
+ $this->_defaultValues
+ ),
+ $contribution->receive_date
+ );
+ }
+
// add custom field values
if (!empty($value['custom']) &&
is_array($value['custom'])