- Merge request !603Resolve #3566256 "Routematch may lack method exists" β (Open) created by Ahmad Khader
`PaymentGatewayForm::dispatchFailedPaymentEvent()` assumes the current route always contains the `commerce_order` parameter. This isnβt always true, given that the form is inline, causing failed payment events to miss the order context and not to be dispatched.
Affected code:
- `modules/contrib/commerce/modules/payment/src/Plugin/Commerce/InlineForm/PaymentGatewayForm.php` reads `$this->routeMatch->getParameter('commerce_order')` as the sole source.
1. Invoke the inline form inside a flow without `commerce_order` in the route.
2. Trigger a gateway failure.
3. Observe missing order context in the dispatched `FailedPaymentEvent`.
- Resolve the order via robust fallbacks:
1. Check `FormStateInterface::getBuildInfo()['callback_object']` and call `getOrder()` if available.
Needs review
3.2
Payment
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.