Skip to content

AbstractEntity and DefaultBackend delete values in the parent scope incorrectly for Custom EAV Entities' Attributes #35058

@ioweb-gr

Description

@ioweb-gr

Preconditions (*)

  1. Magento 2.4.3-p1
  2. A module which creates a custom EAV Entity

Classes responsible for the value saving
\Magento\Eav\Model\Entity\AbstractEntity
\Magento\Eav\Model\Entity\Attribute\Backend\DefaultBackend

Steps to reproduce (*)

  1. Please install the provided module which creates a custom EAV Entity and try to edit the name value in the Content -> TestEntity menu.
  2. Play around with deleting the store view scope value in name attribute.
  3. See the video for detailed explanation
    module.zip

You will notice that whenever you try to save in the store view scope for the attribute name with an empty value or with the use default value checkbox:
one value is going to be deleted in the attribute for the current store id properly
but if there isn't a current value for the store id, the default value is going to be deleted.

There are no docs on the correct procedure to create a custom EAV Entity but even if there was one, this looks more like a bug, rather than missing documentation so I decided to post it here.

Expected result (*)

  1. The AbstractEntity class and the DefaultBackend will delete values only in the currently edited scope and retain the parent scope value

Actual result (*)

  1. The AbstactEntity class and the DefaultBackend will delete values in the parent scope one level above the one being edited.
Notepad_C0cqkEcRaw.mp4

Please provide Severity assessment for the Issue as Reporter. This information will help during Confirmation and Issue triage processes.

  • Severity: S0 - Affects critical data or functionality and leaves users without workaround.
  • Severity: S1 - Affects critical data or functionality and forces users to employ a workaround.
  • Severity: S2 - Affects non-critical data or functionality and forces users to employ a workaround.
  • Severity: S3 - Affects non-critical data or functionality and does not force users to employ a workaround.
  • Severity: S4 - Affects aesthetics, professional look and feel, “quality” or “usability”.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area: FrameworkComponent: AdminIssue: ConfirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedPriority: P3May be fixed according to the position in the backlog.Progress: ready for devReproduced on 2.4.xThe issue has been reproduced on latest 2.4-develop branchTriage: 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