When an order checkout is completed, CheckoutFlowBase::submitForm() first does the workflow transitions, then throws the checkout complete event, and as very last step the order gets saved. This can cause transactional problems as well as the placed timestamp is not saved at the time the event subscribers are acting.

Discussed with bojanz today. This is clearly wrong. The order must be saved first, otherwise it isn't complete.

On the long run, the event will be dropped anyway, as the workflow transition should trigger an event by itself, which isn't the case now. So we'll need a fix for that in the meantime

Comments

agoradesign created an issue. See original summary.

bojanz’s picture

  • bojanz committed 62d8ac0 on 8.x-2.x
    Issue #2760707 by agoradesign, bojanz: Orders are not saved before the...
bojanz’s picture

Status: Active » Fixed

Implemented the discussed fix.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.