Skip to content

Naming collision in Javascript ui registry (backend) #12555

Closed
@EliasZ

Description

@EliasZ

Preconditions

Magento 2.2.1

Steps to reproduce

Add a configurable attribute with attribute code set as "content", or any other name which exists as identifier on the product edit page (for example, "gallery", "review" ,"related").

Add it to the default attribute set

Edit a product.

Expected result

  1. You can properly edit/save the product and add configurations setting that attribute.

Actual result

  1. All kinds of Javascript issues arise when trying to save the product

This is because somehow most HTML elements end up in a registry and are then retrieved on various places. For example:

Magento/ConfigurableProduct/view/adminhtml/web/js/variations/variations.js:365

So when using the name "content" for an attribute, instead of the "content" attribute input, it retrieves the "content" fieldset on the product edit page. This gives a variety of javascript errors such as Element.disabled is not a function.

Could not find where exactly the uiRegistry is filled, but wherever it is the names are not unique enough.

See for example someone else who encountered this problem: Magento 2 - “Element.disabled is not a function” Attribute Error

Metadata

Metadata

Assignees

No one assigned

    Labels

    Fixed in 2.2.xThe issue has been fixed in 2.2 release lineFixed in 2.3.xThe issue has been fixed in 2.3 release lineIssue: Clear DescriptionGate 2 Passed. Manual verification of the issue description passedIssue: ConfirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedIssue: Format is validGate 1 Passed. Automatic verification of issue format passedIssue: Ready for WorkGate 4. Acknowledged. Issue is added to backlog and ready for developmentReproduced on 2.1.xThe issue has been reproduced on latest 2.1 releaseReproduced on 2.2.xThe issue has been reproduced on latest 2.2 releaseReproduced on 2.3.xThe issue has been reproduced on latest 2.3 release

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions