-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Fix issue magento#36759 Update AbstractEntity #37412
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?
Conversation
- Update AbstractEntity to delete custom attribute when given with empty value.
Hi @dimitriss93. Thank you for your contribution! Add the comment under your pull request to deploy test or vanilla Magento instance:
❗ Automated tests can be triggered manually with an appropriate comment:
Allowed build names are:
You can find more information about the builds here For more details, review the Code Contributions documentation. |
@magento run all tests |
The requested builds are added to the queue. You should be able to see them here within a few minutes. Please re-request them if they don't show in a reasonable amount of time. |
@adobe/open-source-office the CLA is signed but not visible. What actions should I take to make it visible? |
- Refactor code
@magento run all tests |
The requested builds are added to the queue. You should be able to see them here within a few minutes. Please re-request them if they don't show in a reasonable amount of time. |
- Refactor code
@magento run all tests |
The requested builds are added to the queue. You should be able to see them here within a few minutes. Please re-request them if they don't show in a reasonable amount of time. |
- Refactor code
@magento run all tests |
The requested builds are added to the queue. You should be able to see them here within a few minutes. Please re-request them if they don't show in a reasonable amount of time. |
any progress by this issue? |
@magento run Integration Tests,Functional Tests CE,Functional Tests BE |
The requested builds are added to the queue. You should be able to see them here within a few minutes. Please message the #magento-devops slack channel if they don't show in a reasonable amount of time and a representative will look into any issues. |
@magento run Functional Tests CE,Functional Tests EE,Functional Tests B2B |
The requested builds are added to the queue. You should be able to see them here within a few minutes. Please message the #magento-devops slack channel if they don't show in a reasonable amount of time and a representative will look into any issues. |
https://github.com/magento run Functional Tests CE,Functional Tests EE,Functional Tests B2B |
@magento run Functional Tests CE,Functional Tests EE,Functional Tests B2B |
The requested builds are added to the queue. You should be able to see them here within a few minutes. Please message the #magento-devops slack channel if they don't show in a reasonable amount of time and a representative will look into any issues. |
@magento run Functional Tests EE,Functional Tests B2B |
The requested builds are added to the queue. You should be able to see them here within a few minutes. Please message the #magento-devops slack channel if they don't show in a reasonable amount of time and a representative will look into any issues. |
https://github.com/magento run Functional Tests CE,Functional Tests B2B |
Description (*)
The method Magento\Eav\Model\Entity\AbstractEntity:_collectSaveData implements some logic to prepare the entity attributes to be saved. The code in lines 1343-1356 of this file (branch magento:2.4-develop), determines wether the attribute value will be created, updated or deleted. The code works fine except for the case when the following two conditions simultaneously happen:
In this case, the expected behaviour would be _canUpdateAttribute to return 'true' and the attribute to be inserted into '$delete' array. But, the _canUpdateAttribute is not able to identify custom_attributes.
Solution: Move the code that updated the '$delete' array outside the branch so that all empty-valued attributes (both normal and custom) are pushed to '$deleted' array.
Related Pull Requests
No related PRs
Fixed Issues (if relevant)
Manual testing scenarios (*)
The code mentioned in the issue (#36759) description has been tested
The expected behaviour, that is the 'emptied' custom attribute to be deleted from the appropriate database table, happens only if the current fix is applied.
Questions or comments
Contribution checklist (*)