Closed HenKun closed 1 year ago
HI @HenKun ,
We are happy to share that we've just released the new 2.18.0 version where we have fixed this issue.
Thank you for opening this issue and for the detailed issue report.
We are closing this issue now but please feel free to reopen the issue if this still occurs.
Describe the bug When coming back to Magento from Mollie Payment page by using back button, the quote is not restored. This is due to an issue in the handling of dates.
Used versions
To Reproduce Steps to reproduce the behavior: Pre: Timezone is configured to be GMT+2 (MESZ/CEST)
loading_screen
Expected behavior The quote is restored and checkout #payment step is openend.
Actual behavior Customer is redirected to empty cart.
Screenshots If applicable, add screenshots to help explain your problem.
Additional context I tracked down the issue to the observer
Observer/ControllerActionPredispatchCheckoutIndexIndex/RestoreQuoteOfUnsuccessfulPayment.php
On line 54 the order creation date is transformed to current timezone by using:This leads to a completely wrong time. In my case the year is modified by 2 years, seconds get removed and hours are not transformed to correct timezone. I do not know if this is a Magento bug, I did not find any related issues. Due to this wrong transformation, the check for being greater than 5 minutes hits and the method returns. (Sie question: What would be the disadvantage to raise this limit or completely remove the check?) However, the following code works perfectly fine:
So I assume the Magento internal handling of stringified dates is wrong, wheres the
new \DateTime
constructor handles the string correctly.I logged the wrong output, so you can see the difference:
The log after the proposed change: