Skip to content

Magento_Catalog: Image attribute should have different parent class #8587

Closed
@koenner01

Description

@koenner01

Currently the 'Magento\Catalog\Model\Product\Attribute\Frontend\Image' model is inheriting from the abstract class 'Magento\Eav\Model\Entity\Attribute\Frontend\AbstractFrontend'.

The class should inherit from 'Magento\Eav\Model\Entity\Attribute\Frontend\DefaultFrontend' instead (which inherits from the abstract). This would be more consistent with other frontend attributes (like datetime) and more flexible in extending the functionalities of the frontend attributes.

Preconditions

  1. PHP7.0
  2. MG2.1.2, MG2.1.3, MG2.1.4

Steps to reproduce

  1. Look at file Magento\Catalog\Model\Product\Attribute\Frontend\Image

Expected result

  1. class should inherit from Magento\Eav\Model\Entity\Attribute\Frontend\DefaultFrontend

Actual result

  1. class inherits from Magento\Eav\Model\Entity\Attribute\Frontend\AbstractFrontend

This fix would allow more flexibility when adding functionalities on the frontend attributes. You would not have to provide an extra preference to fix the 'incorrect' parent class for the image attributes.

An example of where this is already done in the core:
Magento\Eav\Model\Entity\Attribute\Frontend\Datetime

Metadata

Metadata

Assignees

No one assigned

    Labels

    Issue: Format is validGate 1 Passed. Automatic verification of issue format passedIssue: Ready for WorkGate 4. Acknowledged. Issue is added to backlog and ready for development

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions