-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Only load attributes from attribute set of given entity type #39794
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
Only load attributes from attribute set of given entity type
Hi @Maikel-Koek. 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. |
@magento run all tests |
@magento It looks like tests are failing that have nothing to do with my changes. |
The unit test failures do seem related to changes introduced in this PR:
So maybe the unit tests found a bug in this change, or they should be updated. I'll leave that up to you to figure out. |
@magento create issue |
Description
The
eav_entity_attribute
table can contain attributes of different entity types (from third parties), next to thecatalog_product
entity type attributes. These attributes can possibly have the same attribute set IDs as thecatalog_product
entity attribute set IDs.This can cause issues when loading the attributes by attribute set for a product.
For example: when switching a product's attribute set to a different attribute set, the following snippet will try to delete the data of the product of the old attribute set:
https://github.com/magento/magento2/blob/2.4-develop/app/code/Magento/Catalog/Model/ResourceModel/Product.php#L344-L355
This will result in the following error:
On: https://github.com/magento/magento2/blob/2.4-develop/app/code/Magento/Catalog/Model/ResourceModel/Product.php#L373:
Manual testing scenarios
blog_post
andblog_category
entity types), and make sure you have a product attribute set ID with the same attribute set ID of the custom entity type.Call to a member function getBackendTable() on bool
Contribution checklist
Resolved issues: