Details
-
Type: Bug
-
Status: Done/Fixed
-
Priority: Major
-
Resolution: Fixed/Completed
-
Affects Version/s: 3.4.6, 4.0.6
-
Component/s: CiviContribute
-
Labels:None
Description
Back office credit card contributions are getting a date of 1970.
This can be fixed by the patch below but I suspect it is not the correct fix. The processContribution function is acting as a BAO function even though it is in the form layer & the fact that this line differs from the one I submitted (i.e the commit says CRM-8317 but it wasn't in my patch on that issue) suggests that there is another process calling this function which might rely on it being as is.
The problem is arising because CRM_Contribute_Form_Contribution::postProcess is passing 'receive_date' into CRM_Contribute_Form_Contribution_Confirm::processContribution in the full ISO format ('YmdHis') but receive_date_time is also been set & as a result both the date WIth the time AND the time are being passed to the Date function - resulting in an invalid date.
Index: CRM/Contribute/Form/Contribution/Confirm.php
===================================================================
— CRM/Contribute/Form/Contribution/Confirm.php (revision 36450)
+++ CRM/Contribute/Form/Contribution/Confirm.php (working copy)
@@ -982,7 +982,7 @@
'contact_id' => $contactID,
'contribution_type_id' => $contributionType->id,
'contribution_page_id' => $contributionPageId,
- 'receive_date' => ( CRM_Utils_Array::value( 'receive_date', $params ) ) ? CRM_Utils_Date::processDate( $params['receive_date'], CRM_Utils_Array::value( 'receive_date_time', $params ) ) : date( 'YmdHis' ),
+ 'receive_date' => ( CRM_Utils_Array::value( 'receive_date', $params ) ) ? CRM_Utils_Date::processDate( $params['receive_date'] ) : date( 'YmdHis' ),
'non_deductible_amount' => $nonDeductibleAmount,
'total_amount' => $params['amount'],
'amount_level' => CRM_Utils_Array::value( 'amount_level', $params ),