Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
While reviewing
#2546212: Entity view/form mode formatter/widget settings have no translation UI
I noticed a minor screw up. New code is being introduced in the patch which has to make use of deprecated methods in the entityManager namely getDefinitions() and getStorage()
this is because ConfigEntityMapper provides
$this->entityManager
not
$this->entityTypeManager
So this issue is to fix the deprecation so we are no longer railroaded into using outdated methods.
Comment | File | Size | Author |
---|---|---|---|
#7 | 3031346-7.patch | 6.71 KB | martin107 |
#7 | interdiff-3031346-2-7.txt | 972 bytes | martin107 |
Comments
Comment #2
martin107 CreditAttribution: martin107 as a volunteer commentedHere is the first cut patch
a) pull in the preferred entity_type.manager, remove entityManager
b) fix up all classes that extend ConfigEntityMapper
c) cross fingers wait for testbot to complain.
To review my own patch
I am mildly concerned that the removal of $this->entityManager from the class might be seen as a breaking change by contrib.
Unless someone objects I am just going to ignore this concern as contrib if caught out by this should be able to adjust .. If anyone objects then the solution is to reinsert the entityManager back into the class and apply deprecated notices.
Anyway I want to hear what other think.
Comment #3
martin107 CreditAttribution: martin107 as a volunteer commentedminor grammar errors corrected in the issue summary.
Comment #4
martin107 CreditAttribution: martin107 as a volunteer commentedThis patch looks complete to me.
Comment #5
BerdirWe have DeprecatedServicePropertyTrait so that subclasses could still access the entityManager property without breaking.
Also going for a simpler issue title that describes what this issue actually does ;)
Comment #6
BerdirComment #7
martin107 CreditAttribution: martin107 as a volunteer commentedThank you for the review.
I am glad that DeprecatedServicePropertyTrait solves all the concerns about internal properties details being used by contrib.
Comment #8
BerdirLooks good to me. I think this is a useful separate part to update. There's another issue for forms that's not yet RTBC, just in case you want to help with entity manager conversions: #2969109: Replace deprecated usages of entityManager in form classes. That (helping with these issues) would be very appreciated, but we need to be careful to not have too many overlapping issues with conflicts. I'm trying to keep the parent issue updated with the current focus.
Comment #10
BerdirDrupalCI was unhealthy, latest patch is green again.
Comment #12
BerdirDrupalCI was unhealthy again, latest patch is again green again.
Comment #13
alexpottCommitted ad0506c and pushed to 8.7.x. Thanks!
Fixed docs on commit.