-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Preserve existing store labels when updating attribute option via API #40095
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
base: 2.4-develop
Are you sure you want to change the base?
Preserve existing store labels when updating attribute option via API #40095
Conversation
Hi @mimou78. Thank you for your contribution!
Allowed build names are:
You can find more information about the builds here For more details, review the Code Contributions documentation. |
…a API (issue magento#40093) - Updated
- Added condition for PR marked as Changes Requested. - Added condition for the issue close to remove from the project.
Removed condition PR changes requested
Added copyright information in the file
@magento run all tests |
…a API (issue magento#40093) - Updated
@magento run Unit Tests |
- Added condition for PR marked as Changes Requested. - Added condition for the issue close to remove from the project.
@magento run Static Tests |
@magento run Integration Tests |
@magento run Functional Tests CE |
@magento run Functional Tests B2B |
@magento run all test |
Failed to run the builds. Please try to re-run them later. |
@magento run all tests |
Description (*)
This PR fixes an issue where updating a product attribute option via the API endpoint:
PUT /V1/products/attributes/byAttributeCode/options/byOptionId
would unintentionally erase store-specific labels that were not included in the payload.
Magento's current implementation of
\Magento\Eav\Model\Entity\Attribute\OptionManagement::saveOption()
overwrites all store_labels for an option when updating just one, instead of merging them. This fix introduces logic to preserve existing store labels and only update those explicitly provided.Related Pull Requests
Fixed Issues (if relevant)
Manual testing scenarios (*)
Questions or comments
Contribution checklist (*)