Problem/Motivation

\Drupal\Core\Entity\EntityTypeRepositoryInterface::clearCachedDefinitions() is deprecated but we still use it in a test trait

Proposed resolution

Add @trigger to the method implementation.

Remaining tasks

User interface changes

none

API changes

none

Data model changes

none

Release notes snippet

N/a

CommentFileSizeAuthor
#2 3068858-2.patch2.07 KBalexpott
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

alexpott created an issue. See original summary.

alexpott’s picture

Status: Active » Needs review
FileSize
2.07 KB
Berdir’s picture

Status: Needs review » Reviewed & tested by the community

My comment from #2549143: Deprecate EntityTypeRepository::clearCachedDefinitions() on why I think this method isn't needed:

And then there's \Drupal\Core\Entity\EntityTypeRepositoryInterface::clearCachedDefinitions(), but interestingly, there is no not a single call to that method as far as I see now in core because that being necessary is extremely rare, it would require a new entity coming into existence *without* a container rebuild *and* then being used through a static ThatEntityType::load() in the same request. Because unlike the other caches, it's really just a static cache while everything else actually mainly about persistent caches. So we could actually deprecate that fully with a @trigger_error() but I don't think we need a fancy generic solution as a replacement.

As a last resort, there's the option to unset a service on the container to have it re-intialized (does however not work if that is injected somewhere).

This also already passed in that issue, so it should still pass here.

catch’s picture

Status: Reviewed & tested by the community » Fixed

Committed 35411a4 and pushed to 8.8.x. Thanks!

  • catch committed d747dec on 8.8.x
    Issue #3068858 by alexpott, Berdir: Properly deprecate \Drupal\Core\...
catch’s picture

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.