Problem/Motivation

In #3127026: Not possible to override an entity type class multiple times, the only Core usage of EntityTypeInterface::getOriginalClass() had been removed.

As suggested in https://git.drupalcode.org/project/drupal/-/merge_requests/12799#note_61...

This is the only usage in core runtime code of this method. We should open a follow-up to deprecate and tell people to using the new method - it is likely any calls to it should change or would be made more robust.

Remaining tasks

- mark method as deprecated

User interface changes

None

Introduced terminology

None

API changes

Method deprecated:
- EntityTypeInterface::getOriginalClass()

Data model changes

None

Release notes snippet

Reference the change record of the parent issue.

Issue fork drupal-3557461

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

grimreaper created an issue. See original summary.

Version: 11.x-dev » main

Drupal core is now using the main branch as the primary development branch. New developments and disruptive changes should now be targeted to the main branch.

Read more in the announcement.

grimreaper’s picture

Assigned: Unassigned » grimreaper
grimreaper’s picture

Version: main » 11.x-dev

grimreaper’s picture

Assigned: grimreaper » Unassigned
Status: Active » Needs review

I can't access downstream test results.

smustgrave’s picture

Version: 11.x-dev » main
Status: Needs review » Needs work

Will still have to land in main first please

smustgrave’s picture

And point to a CR please

grimreaper’s picture

Assigned: Unassigned » grimreaper

CR will be the one from the parent issue: https://www.drupal.org/node/3557464

grimreaper’s picture

Assigned: grimreaper » Unassigned
Status: Needs work » Needs review
grimreaper’s picture

Issue tags: +DevDaysAthens2026
smustgrave’s picture

I think it probably needs its own at this point. That CR is published and released in 11.3 already so the deprecations wouldn’t line up.

grimreaper’s picture

Assigned: Unassigned » grimreaper
grimreaper’s picture

Assigned: grimreaper » smustgrave
smustgrave’s picture

Assigned: smustgrave » Unassigned
Status: Needs review » Reviewed & tested by the community

CR looks good to me!

alexpott’s picture

Status: Reviewed & tested by the community » Needs work

Can you add asserts about the deprecation message otherwise we don't know that the ignore deprecation attribute is actually necessary.

grimreaper’s picture

Assigned: Unassigned » grimreaper
grimreaper’s picture

Assigned: grimreaper » Unassigned
Status: Needs work » Needs review

And back to needs review.

alexpott’s picture

Status: Needs review » Needs work

\Drupal\Tests\Core\Entity\EntityTypeRepositoryTest we can remove all the mocking of getOriginalClass() from there,

grimreaper’s picture

Status: Needs work » Needs review

Done.

Unrelated test failures.

smustgrave’s picture

Status: Needs review » Reviewed & tested by the community

Feedback appears to be addressed.

alexpott’s picture

Version: main » 11.x-dev
Status: Reviewed & tested by the community » Fixed

Committed and pushed 5dd07510157 to main and ca4b8596b00 to 11.x. Thanks!

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

  • alexpott committed ca4b8596 on 11.x
    task: #3557461 Deprecate EntityTypeInterface::getOriginalClass
    
    By:...

  • alexpott committed 5dd07510 on main
    task: #3557461 Deprecate EntityTypeInterface::getOriginalClass
    
    By:...

grimreaper’s picture

Thanks for the merge!

The follow up issue had been updated and rebased. So this thread can be definitely done.