From ffc9d3b2d17571d487c255abcfdf3cf2ef868365 Mon Sep 17 00:00:00 2001 From: eileen Date: Fri, 7 Jun 2019 01:09:47 +1200 Subject: [PATCH] Add default receive_date for contributions at BAO level I found that CRM_Contribute_Page_AjaxTest actually fails if run in isolation - obviously 'something' is helping it out when run together but in isolation the receive_date is missing on the contribution which causes an error when it goes to save financial item. (There was a similar test issue recently that turned out to impact form users - this solves the issue deeper down. The default is only applied if id is not present --- CRM/Contribute/BAO/Contribution.php | 1 + 1 file changed, 1 insertion(+) diff --git a/CRM/Contribute/BAO/Contribution.php b/CRM/Contribute/BAO/Contribution.php index 6a81bc618587..dc13d67cf427 100644 --- a/CRM/Contribute/BAO/Contribution.php +++ b/CRM/Contribute/BAO/Contribution.php @@ -301,6 +301,7 @@ public static function getDefaults() { FALSE, FALSE, FALSE, 'AND is_default = 1') ), 'contribution_status_id' => CRM_Core_PseudoConstant::getKey('CRM_Contribute_BAO_Contribution', 'contribution_status_id', 'Completed'), + 'receive_date' => date('Y-m-d H:i:s'), ]; }