civicrm/civicrm-core — pull request #1287 by pratik-joshi (2013-07-31 09:01:42+00:00)
Title: CRM-13035-fix : initiating CRM_Contribute_BAO_Contribution instead of CRM_Contribute_DAO_Contribution

The fix consists of 2 changes :

1) Initialization changes inside 'validateData()' (Only this change can also fix this issue):

- validateData converts the receive_date to proper format and stores in the $contribution object, then further this object in passed in 'loadObjects()' function which checks if the $contribution object passed is CRM_Contribute_BAO_Contribution class object, if not this object is re-assigned to CRM_Contribute_BAO_Contribution class object. So in previous versions due to CRM_Contribute_DAO_Contribution initialization, the properly converted value was getting overidden by re-initialized object value

- The re-initialization check was introduced because few function (e.g loadRelatedObjects) definitions are placed inside CRM_Contribute_BAO_Contribution by https://fisheye2.atlassian.com/viewrep/CiviCRM/trunk/CRM/Core/Payment/BaseIPN.php?r1=&r2=39563 for CRM-9996 issue.

2) Date convertion changes within function 'failed()' :

Did this because 'failed()' method can also be externally called with $objects as parameter, so it can consist of un-formatted date values.

The issue works fine with both the mentioned changes.