-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Description
When creating a new product attribute through code, product attribute repository save method resets source model to null or something else. Therefore a new attribute is created with an empty option (in case of select or multiselect input type). This happens only for new attributes not when updating exiting attributes.
Expected Result
It is expected that when some data is set on a model, repository should not change or reset it.
Preconditions
Magento Version 2.1.7 CE and EE
Steps to reproduce
-
Copy Example/Catalog module into app/code directory.
-
Install module
./bin/magento module:enable "Example_Catalog" ./bin/magento setup:upgrade ./bin/magento setup:di:compile -
Run command to create an example product attribute
./bin/magento example:catalog:create_attribute
Actual Result
-
In magento admin panel you should see attribute
example_attribute_codeof input typeselecthaving just an empty option. -
Run the command again and you should see the attribute has options from source model.