-
Notifications
You must be signed in to change notification settings - Fork 9.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Attribute repository resets sourceModel for new attributes #10814
Comments
looks perfectly valid to me as you cannot have different source models for the same |
@orlangur I've updated the example code. I think the repository should only set source model if not set already. |
Again:
|
Yes
|
Ok, thanks for the detailed explanation, it looks like So, you just need a regular new select/multiselect but with custom source model. Not sure it should be treated as bug report or a feature request, so, leaving without such label for now. |
@adi3009 thank you for your bug report. |
Hi @adi3009 |
Hi @okorshenko, @orlangur Is this fixed and released, I can replicate the issue in 2.2.4 |
can also replicate in 2.2.5 |
@engcom-backlog-tomash Thank you for verifying the issue. Based on the provided information internal tickets |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed after 14 days if no further activity occurs. Is this issue still relevant? If so, what is blocking it? Is there anything you can do to help move it forward? Thank you for your contributions! |
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
Product Attribute Repository
Example Code
Steps to reproduce
Copy Example/Catalog module into app/code directory.
Install module
Run command to create an example product attribute
Actual Result
In magento admin panel you should see attribute
example_attribute_code
of input typeselect
having just an empty option.Run the command again and you should see the attribute has options from source model.
The text was updated successfully, but these errors were encountered: