Skip to content

Interceptor preference and plugin disabled="true" attribute stopped working #40650

@webloft

Description

@webloft

Summary

For some reason our <preference/> does not work anymore after magento patch.2.4.6p14, so we started troubleshooting...

We don't know if it's only affected to the version, it started with updating the codebase - maybe another component is involved. We experienced that behavior on 2 different projects.

So far

  • preference for interfaces seems to work (of course that would break anything otherwise)
  • preference to override a simple class does not
  • new plugins are working
  • disabled="true" didn't work on existing plugins, now it does without change - strange

Magento does not complain about the preference at compilation time and it shows the preference registered by di:info command, yet the original class is now loaded, not the preference as it did before.

Examples

The preference we need to override (because it's buggy) is:

Magento\Tax\Model\Sales\Total\Quote\CommonTaxCollector

The other example is a simple plugin on load() of

Magento\Catalog\Model\ResourceModel\Product\Collection

Yeah, it may work in a vanilla empty instance - we didn't test it, also this doesn't help much - we want to know what probably could be broken or has changed.

Could someone please respond if there are breaking changes to this topic?

Edit:

Proposed solution

No response

Release note

No response

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

    Type

    No type

    Projects

    Status

    Ready for Confirmation

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions