Problem/Motivation
In modules/payment/src/Entity/Payment.php the edit-form link template is:
"edit-form" = "/admin/commerce/orders/{commerce_order}/payments/commerce_payment/edit"
commerce_payment is a literal string here, not a {commerce_payment} placeholder, while the delete-form template on the next line uses {commerce_payment} correctly.
Modules that build routes from the edit-form template get the wrong parameters. With Devel installed, devel-load becomes /devel/commerce_payment/{commerce_order} (no payment parameter). Choosing "Devel" from the payment operations dropdown on the order Payments page throws:
Symfony\Component\Routing\Exception\MissingMandatoryParametersException: Some mandatory parameters are missing ("commerce_payment") to generate a URL for route "entity.commerce_payment.token_devel".
Steps to reproduce
1. Install Drupal 11 with Commerce 3.x and Devel 5.x (and Token).
2. Create an order and add a payment to it (e.g. using the Manual gateway).
3. Go to /admin/commerce/orders/{order_id}/payments.
4. Open the operations dropdown for the payment and click "Devel".
5. The page fails with the exception above.
Proposed resolution
Add the missing braces:
"edit-form" = "/admin/commerce/orders/{commerce_order}/payments/{commerce_payment}/edit"
After this change the Devel link becomes /devel/commerce_payment/{order_id}/{payment_id} and the page loads correctly.
Issue fork commerce-3629570
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
vivek_lnwebworks commentedComment #6
jsacksick commented