Skip to content

Can't add customizable options to product #11792

Closed
@mikelevy300

Description

@mikelevy300

Preconditions

  1. PHP 7.0.16
  2. MySQL 5.7
  3. Apache 2.4
  4. Magento 2.1.9 (I was able to recreate this w/ both the sample data and the data from my store)

Steps to reproduce

  1. Go into the admin panel and navigate to Stores->Attribute Set
  2. Edit the default attribute set, add a new group named 'Options', add a few attributes to the new group, and save the group
  3. Navigate toe Products->Catalog and choose any product with the default attribute set to edit
  4. Expand the Customizable Options section and click the 'Add Option' button

Expected result

  1. A new customizable option form should appear

Actual result

  1. Nothing happens on the page
  2. A 'Uncaught TypeError: Cannot read property 'apply' of undefined' error is thrown in the console

The full stack trace for the console error is:

Uncaught TypeError: Cannot read property 'apply' of undefined
at registry.js:54
at Registry._resolveRequest (registry.js:413)
at Registry._addRequest (registry.js:380)
at Registry.get (registry.js:224)
at async (registry.js:53)
at UiClass.applyAction (button.js:72)
at Array.forEach ()
at UiClass.action (button.js:50)
at HTMLButtonElement. (knockout.js:3863)
at HTMLButtonElement.dispatch (jquery.js:5226)

I traced it out and what is happening is there are two UIClass objects on the page with the same 'ns'=>'product_form' and 'index'=>'options' properties. This is occurring because the 'Options' attribute group we just created was given the attribute group code 'options' and that attribute group code appears to be the value that's used for the 'index' key in the resulting UIClass object. If we go back and delete the 'Options' group out of the attribute set, the button goes back to working like it should. I also tested out just renaming the group; however, it appears that the attribute group code is only set when the group is created. So changing the name later won't update the attribute group code.

Metadata

Metadata

Assignees

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