Skip to content

[Issue] Only load attributes from attribute set of given entity type #39815

Description

@m2-assistant

This issue is automatically created based on existing pull request: #39794: Only load attributes from attribute set of given entity type


Description

The eav_entity_attribute table can contain attributes of different entity types (from third parties), next to the catalog_product entity type attributes. These attributes can possibly have the same attribute set IDs as the catalog_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:

Call to a member function getBackendTable() on bool

On: https://github.com/magento/magento2/blob/2.4-develop/app/code/Magento/Catalog/Model/ResourceModel/Product.php#L373:

Manual testing scenarios

  1. Create a custom entity type, or install a third party extension which adds custom entity types (like https://mirasvit.com/magento-2-extensions/blog.html, which adds blog_post and blog_category entity types), and make sure you have a product attribute set ID with the same attribute set ID of the custom entity type.
  2. Try to switch the attribute set of an existing product, which currently has a product attribute set ID which is the same as one of the custom entity type IDs.
  3. When trying to save the product, the following error will appear:
    Call to a member function getBackendTable() on bool

Contribution checklist

  • Pull request has a meaningful description of its purpose
  • All commits are accompanied by meaningful commit messages
  • All new or changed code is covered with unit/integration tests (if applicable)
  • README.md files for modified modules are updated and included in the pull request if any README.md predefined sections require an update
  • All automated tests passed successfully (all builds are green)

Activity

  1. added
    Triage: Dev.ExperienceIssue related to Developer Experience and needs help with Triage to Confirm or Reject it
    on May 19, 2025
  2. self-assigned this
    on Jun 9, 2025
  3. m2-assistant commented on Jun 9, 2025

    @m2-assistant
    Author

    Hi @engcom-Hotel. Thank you for working on this issue.
    In order to make sure that issue has enough information and ready for development, please read and check the following instruction: 👇

    • 1. Verify that issue has all the required information. (Preconditions, Steps to reproduce, Expected result, Actual result).
    • 2. Verify that issue has a meaningful description and provides enough information to reproduce the issue.
    • 3. Add Area: XXXXX label to the ticket, indicating the functional areas it may be related to.
    • 4. Verify that the issue is reproducible on 2.4-develop branch
      Details- If the issue is reproducible on 2.4-develop branch, please, add the label Reproduced on 2.4.x.
      - If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and stop verification process here!
    • 5. Add label Issue: Confirmed once verification is complete.
    • 6. Make sure that automatic system confirms that report has been added to the backlog.
  4. engcom-Hotel commented on Jun 9, 2025

    @engcom-Hotel
    Contributor

    Hello @Maikel-Koek,

    Thanks for the report & collaboration!

    We have tried to reproduce the issue in the latest 2.4-develop branch, but the issue seems not reproducible for us. We are able to save the product with the new attribute set.

    We request you to please provide us the a screencast which shows issue for you.

    Thanks

  5. moved this from Ready for Confirmation to Needs Update in Issue Confirmation and Triage Boardon Jun 9, 2025
  6. engcom-Hotel commented on Jun 24, 2025

    @engcom-Hotel
    Contributor

    Hello @Maikel-Koek,

    Have you got a chance to look into this #39815 (comment)?

    Thanks

  7. engcom-Hotel commented on Jul 22, 2025

    @engcom-Hotel
    Contributor

    Dear @Maikel-Koek,

    This issue is being closed due to inactivity over an extended period. If the issue still persists, please feel free to reopen it or create a new ticket with the relevant details.

    Thank you for your understanding.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Issue: needs updateAdditional information is require, waiting for responseReported on 2.4.xIndicates original Magento version for the Issue report.Triage: Dev.ExperienceIssue related to Developer Experience and needs help with Triage to Confirm or Reject it

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions