Fixed
Project:
Commerce Core
Version:
3.x-dev
Component:
Order
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
13 Oct 2026 at 15:11 UTC
Updated:
15 Oct 2026 at 09:44 UTC
Jump to comment: Most recent
Prior to the new OMS in 3.3.x, and within an order's "Edit" tab, you could enable a "Duplicate" order item button. This functionality still exists IF the order "Edit" tab is enabled in 3.3.x, but the "Duplicate" functionality DOES NOT exist as an inline operation in the OMS order view.
In 3.3.x:
The expectation is:
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 #2
morbus iffComment #3
morbus iffComment #4
tbkot commentedWorking on it
Comment #7
tbkot commentedComment #8
vipin.j commentedduplicate action link not working! AJAX request failed with following error:
Comment #9
jsacksick commented@vipin.j: You need to clear caches after pulling the code...
Comment #11
jsacksick commentedComment #15
fenstratReopening for a follow-up, see MR !758.
Since this was committed, deleting an order item that doesn't belong to an order throws when menu_link_content is enabled:
Drupal\Core\Entity\EntityStorageException: Parameter "commerce_order" for route "entity.commerce_order_item.duplicate_form" must match "[^/]++" ("" given) to generate a corresponding URL.menu_link_content_entity_predelete()generates the URL of every link template viauriRelationships().OrderItem::toUrl()returns<nolink>when there's no order, but only foredit-formanddelete-form(#3574237), so the newduplicate-formlink falls through with an emptycommerce_orderparameter.The MR replaces that hardcoded list with a check for any link template containing
{commerce_order}, so future order-scoped links are covered too. It adds kernel tests toOrderItemTest:testToUrl(): every order-scoped link returns<nolink>without an order, and generates the real admin URL once the item belongs to one.testDeleteWithoutOrder(): deletes an order item without an order with menu_link_content enabled, mirroringProductVariationTest::testDeleteIncomplete().Both tests fail without the fix.
This contribution was developed with AI assistance throughout the process. I reviewed the change, understand it, and take responsibility for its correctness.
Comment #16
tbkot commentedThanks @fenstrat for finding it and for the fix. It looks good to me
Comment #18
jsacksick commented