Membership start date ignores trxn_date/receive_date gets recalculated to today
Overview
https://chat.civicrm.org/civicrm/pl/5bwnarinz7y73nwdjri9oidyno
Reproduction steps
Do an Order.create call which includes:
-
receive_date
:2020-01-01
- entity
params
in the line item contain2020-01-01
forstart_date
.
This works, a pending membership is created with the start date of 2020-01-01
but then the subsequent Payment.create which includes the same historical trxn_date
updates the membership's start_date
to today.
Expected behaviour
Membership start date should take the date of the transaction. (I belive this was the case up to and including 5.39 but not in 5.40)
Environment information
buildkit d7 Civi 5.40
Comments
This was picked up by the test assertion at
https://lab.civicrm.org/extensions/gocardless/-/blob/main/tests/phpunit/GoCardlessTest.php#L915
After the work is done in
https://lab.civicrm.org/extensions/gocardless/-/blob/main/tests/phpunit/GoCardlessTest.php#L1913
and specifically the Payment.create at
https://lab.civicrm.org/extensions/gocardless/-/blob/main/tests/phpunit/GoCardlessTest.php#L1998
These tests have been completely rewritten. See extensions/gocardless#123 (closed)