Skip to content

Backward compatibility has been lost on Magento\Catalog\Model\ProductRepository class #38669

Closed
@davidmolinacano

Description

@davidmolinacano

Summary

I've a module that have a ProductRepository class which extends from the core Magento\Catalog\Model\ProductRepository class. We were calling the parent::__construct passing the Magento\Catalog\Controller\Adminhtml\Product\Initialization\Helper class which was required before Magento 2.4.7 as the 2nd parameter of the constructor, but now it has been removed and the second parameter must be Magento\Catalog\Api\Data\ProductSearchResultsInterfaceFactory class instead, thus losing the backward compatibility.

Examples

image

(Tested on Magento 2.4.3 after having removed the initialization helper from the parent::__construct)

Proposed solution

My proposal is to restore the Magento\Catalog\Controller\Adminhtml\Product\Initialization\Helper class as the second parameter. Although it's unused as you stated on the changelog, in my opinion it's required to guarantee the backward compatibility.

This bug can be reproduced by installing our module (version 0.13.13) on a Magento 2.4.7 and then executing a bin/magento setup:di:compile

Release note

Release Line: 2.4.7

Triage and priority

  • 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: FrameworkIssue: ConfirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedIssue: needs updateAdditional information is require, waiting for responsePriority: P1Once P0 defects have been fixed, a defect having this priority is the next candidate for fixing.Progress: doneReported on 2.4.7Indicates original Magento version for the Issue report.Reproduced 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

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions