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.
Problem/Motivation
The entity.manager service is deprecated.
We should inject its replacements in core services.
Proposed resolution
Convert core service definitions in core.services.yml to use non-deprecated entity services.
Remaining tasks
Follow-up with core module service definitions: #2977107: Use more specific entity.manager services in module .services.yml files
User interface changes
API changes
Additional dependencies injected.
Data model changes
Comment | File | Size | Author |
---|---|---|---|
#154 | 2624770-154-interdiff.txt | 17.76 KB | Berdir |
#154 | 2624770-154.patch | 93.36 KB | Berdir |
#152 | interdiff-152.txt | 3.12 KB | amateescu |
#152 | 2624770-152.patch | 85.49 KB | amateescu |
#144 | 2624770-144.patch | 84.17 KB | jofitz |
Comments
Comment #2
cilefen CreditAttribution: cilefen commentedI don't see how a novice would know how to proceed on this issue. I just about barely understand it.
Comment #3
claudiu.cristeaThis will change some class constructor signatures and also some interfaces. For example
\Drupal\Core\Config\ConfigManagerInterface
:__construct()
is now an entity manager object but will be an entity type manager.::getEntityManager()
will return an entity type manager object instead of entity manager. Course, this method will be deprecated and we'll add a clone::getEntityTypeManager()
but it still return other object than now in HEAD.Is this OK for 8.1.x?
I'm illustrating with this patch.
Comment #5
claudiu.cristeaThis is keeping the interface BC but not constructor signature.
Comment #7
claudiu.cristeaThis is 100% BC. Maybe we need to default the new arguments from signature to NULL?
Comment #8
dawehnerThis is odd, why do we not just inject things?
Do we really deprecate on property level? Interesting
Comment #9
claudiu.cristea@dawehner, as we've discussed on IRC, I picked up other example. There's only one use case (I will extend the patch to all use cases after discussing).
Question: Does the service constructor signature change (in this case
ContentUninstallValidator::__construct()
) represent a BC break? I think, yes. So, I'm not sure that this can go as replacement. In this case I think we need to deprecate theentity.manager
service argument and add theentity_type.manager
as optional argument at the end of signature, so we don't break existing classed that are extendingContentUninstallValidator
.Comment #10
claudiu.cristeaI guess such a change can break existing sites that are using
sites/default/services.yml
. Moving to 9.xComment #11
dawehnerWell, in case we have a 1to1 replacement that works, it is just a problem, if you have additional ones.
Comment #12
claudiu.cristeaYou mean: If an argument expects an
EntityTypeManagerInterface
object buta custom modulean existing site will still pass the oldEntityManagerInterface
object, this is OK becauseEntityManagerInterface
inheritsEntityTypeManagerInterface
?Comment #13
claudiu.cristeaI picked-up only those where i can do a 1-to-1 replacement.
Comment #14
claudiu.cristeaComment #15
claudiu.cristeaComment #16
dawehnerExactly ...
Comment #17
claudiu.cristeaForgot the core modules.
Comment #18
claudiu.cristeaThis is now a huge patch :(
Comment #20
claudiu.cristeaStill needs work.
Comment #21
claudiu.cristeaOK, ready for a review. But I think this should go in 8.0.x. Reason: The module developers are using core (and core modules) as a primary inspiration source. They will continue to use
@entity.manager
because in YAML their IDE do not mark that value as deprecated. Very few of them will go the the service class and see the deprecation note. We have to encourage them to use the new entity services instead of EntityManager.Comment #22
claudiu.cristeaCreated #2627938: Add docs to *.services.yml to tell that @entity.manager is deprecated for 8.0.x.
Comment #23
claudiu.cristeaMoving to 8.0.x as per #21.
Comment #25
claudiu.cristeaRerolled for 8.0.x.
Comment #26
claudiu.cristeaComment #27
dawehnerI think we want to fix that in 8.1.x only, due to potential breakage
Comment #30
BerdirComment #32
20th CreditAttribution: 20th commentedPrevious patch is out of date. Rerolling with mostly the same contents, with exception for some of the patched files that are already deleted.
Comment #33
Berdirentity.query itself is deprecated too, so maybe we want to leave that out to avoid conflicts with #2389335: Deprecate entity.query service and replace with using the entity storage's getQuery() method?
Comment #34
claudiu.cristeaThere's a BC risk with this patch. Suppose there's a class extending a service where @entity.manage is injected and we replace entity manager with @entity_type.manager. If that extension will use a method that is part of @entity.manager but not part of @entity_type.manager, will crash.
Comment #35
tim.plunketthttps://www.drupal.org/core/d8-bc-policy#constructors
Comment #36
BerdirYeah, that's the official policy, but we still end up breaking modules if we change constructors of subclassed classes.
That said that's not even the point of #34, but the fact that we *change* a property of those classes, so subclasses that do $this->entityManager will then break. But those are also considered @internal. Still, we end up breaking stuff, so at least on base classes like e.g. an EntityForm, we can't just change it. But I think most services here are usually not extended.
Comment #37
20th CreditAttribution: 20th as a volunteer and commentedNone of those replaced properties are tagged with
@internal
and they are notprivate
so there is nothing that would stop developers from using them in subclasses. The question is how likely is it? Should we check every single contrib module on d.org for this kind of subclasses? That way we will know that this patch at least won't break sites that do not contain custom code.If this BC risk is considered plausible, this patch can be committed only in Drupal 9. Unless #2575081: [policy, no patch] Use E_USER_DEPRECATED in Drupal 8 minor releases is accepted sooner, in which case we will have a lot of errors.
Comment #38
tim.plunkettThat's fine, but this issue is about services only. There is no BC break here.
Comment #39
20th CreditAttribution: 20th as a volunteer and commentedSo I actually did download all contrib modules with Drupal 8 versions on d.org, and – who would have though! – found at least 3 modules that do exactly what @claudiu.cristea describes in #34:
entity_pilot, replication, subsite
Here is an (edited) example from dev version of
subsite
module:Drupal\book\BookManager
is one of the files that are updated by the patch and it does not haveentityManager
property anymore.And even more modules extend some of the patched classes and override class constructor. Example from
default_content
module:The child constructor passes the wrong type of object to the parent but this does not seem to cause any errors actually.
So what will it be: postponed or won't fix?
Comment #40
tim.plunkettThose aren't protected by the BC policy. Idk how else to explain it.
Comment #41
20th CreditAttribution: 20th as a volunteer and commented@tim.plunkett
So basically, it is a bug in contrib modules that do not use Drupal API correctly?
Comment #42
BerdirNo, it is not a bug. They're simply doing something is not covered by the BC policy. That's OK, they simply have to live with the consequences.
I recently wrote a blog post on how to override a service with additional dependencies and avoiding to touch the constructor to avoid a case like this, works only for services though: http://www.md-systems.ch/de/blog/techblog/2016/12/17/how-safely-inject-a...
If you want to be nice, you could write a patch for default_content and other modules that do this and rewrite their code like this, then they should be compatible both with HEAD and this patch.
Comment #44
BerdirThis will need a reroll now after #2389335: Deprecate entity.query service and replace with using the entity storage's getQuery() method got in. That probably conflicted on quite a bunch of services and some were already updated to ue entity_type.manager as part of that issue too.
Comment #45
20th CreditAttribution: 20th as a volunteer and commentedAlready working on it. Not a bunch, just 3 actually.
Comment #46
20th CreditAttribution: 20th as a volunteer and commentedWork still in progress, uploading to run the tests.
Comment #48
20th CreditAttribution: 20th as a volunteer and commentedOops..
Comment #50
20th CreditAttribution: 20th as a volunteer and commentedComment #52
20th CreditAttribution: 20th as a volunteer and commentedComment #54
20th CreditAttribution: 20th as a volunteer and commentedComment #56
20th CreditAttribution: 20th as a volunteer and commentedComment #58
20th CreditAttribution: 20th as a volunteer and commentedComment #60
20th CreditAttribution: 20th as a volunteer and commentedComment #62
BerdirHm. If this is needed then that sounds like a bug.
Comment #63
20th CreditAttribution: 20th as a volunteer and commentedIt is certainly a bug in this part of EntityManager:
I don't know how to deal with this part right now. So instead of copy-pasting this code into
EntityDefinitionUpdateManager
, I've decided to keep dependency on 'entity.manager'.Comment #65
20th CreditAttribution: 20th as a volunteer and commentedComment #66
20th CreditAttribution: 20th as a volunteer and commentedGood, they are all finally passing. Issue summary update is on its way.
Comment #67
BerdirReroll, conflicted in hal and seriaization.services.yml (plus moved files that git rebase handled automatically)
Comment #68
Berdirwondering if we should already updated those usages here as well but this patch is big enough, lets make a follow-up?
that said, It is also not clear to me why we inject this through the config manager and don't inject the entity type manager into those services directly? Then we could just deprecate it without replacement. Probably @alexpott knows more.
Comment #70
alexpottre #68 The reason the ConfigManager exposed the entity manager is because it exposes a method
getEntityTypeIdByName()
often this is followed by doing something with the entity type. I think when I wrote this I felt that injecting both was overkill because the ConfigManager had a clear dependency on the entity manager. Also, \Drupal\Core\Config\ConfigImporter has enough injected already.Comment #71
20th CreditAttribution: 20th as a volunteer and commentedComment #72
Berdirshouldn't this also be the entity_type.manager?
Comment #73
20th CreditAttribution: 20th as a volunteer and commentedYep. Missed it.
Comment #74
20th CreditAttribution: 20th as a volunteer and commentedIs it allowed to reorder arguments in a class constructor? Instead of this order in
ContentEntityNormalizer
, for example:I would rather see services logically grouped like this:
Comment #76
20th CreditAttribution: 20th as a volunteer and commentedAnother reroll after #2751325: All serialized values are strings, should be integers/booleans when appropriate
Comment #77
20th CreditAttribution: 20th as a volunteer and commentedAdding correct description to updated class properties and constructor agrument. And replacing one instance of
\Drupal::entityManager()
call with a service injection.Comment #78
Munavijayalakshmi CreditAttribution: Munavijayalakshmi at Valuebound commentedLine exceeding 80 characters.
The Multiline comments should not be in single line as per coding standards.
Comment #79
Munavijayalakshmi CreditAttribution: Munavijayalakshmi at Valuebound commentedThe patch #77 getting error: patch failed.
Comment #80
20th CreditAttribution: 20th as a volunteer and commentedAnother reroll after #2776975: March 3, 2017: Convert core to array syntax coding standards for Drupal 8.3.x RC phase and #2854529: Fix Drupal.Scope.MethodScope - all methods should have scopes
#78.1: Fixed, thanks!
#78.2: That is not a multiline comment, it's a variable type hint which is a bit special.
Comment #82
20th CreditAttribution: 20th as a volunteer and commentedComment #83
20th CreditAttribution: 20th as a volunteer and commentedReroll and minor code clean-up: missing doc comments; order of constructor arguments; and removed unused service injection into
SystemManager
.Comment #84
Mile23Related: #2886622: Deprecate all EntityManager methods with E_USER_DEPRECATED
Also, I think this stands a better chance of getting in if we increase consistency by limiting scope, such as only changing the deprecated entity.manager to entity_type.manager in services.yml files.
Comment #86
Mile23No longer applies.
Comment #87
derheap CreditAttribution: derheap as a volunteer commentedComment #88
derheap CreditAttribution: derheap as a volunteer commentedRerolled the patch from #83.
Comment #90
jofitz CreditAttribution: jofitz at ComputerMinds commentedA few minor corrections to the re-roll.
Comment #92
jofitz CreditAttribution: jofitz at ComputerMinds commentedAddress some test failures.
Fix coding standards error.
Comment #94
jofitz CreditAttribution: jofitz at ComputerMinds commentedThis was the patch I meant to upload.
Comment #95
Sutharsan CreditAttribution: Sutharsan at LimoenGroen commentedPatch no longer applies. Needs reroll.
It's a huge patch, I reviewed visually at some 50+ places. These are my two most serious concerns ... and both are minor :)
Outdated. Sigh, why do we do these things to ourselves
Typo in class name.
Comment #97
savkaviktor16@gmail.com CreditAttribution: savkaviktor16@gmail.com at Skilld commentedRe-rolled
Comment #99
jofitz CreditAttribution: jofitz at ComputerMinds commentedComment #100
mohit1604 CreditAttribution: mohit1604 at Google Summer of Code commentedComment #101
mohit1604 CreditAttribution: mohit1604 at Google Summer of Code commentedComment #103
mohit1604 CreditAttribution: mohit1604 at Google Summer of Code commentedComment #104
mohit1604 CreditAttribution: mohit1604 at Google Summer of Code commentedNo error is shown in terminal while applying patch , don't know why it's failing test !!!
Comment #105
jofitz CreditAttribution: jofitz at ComputerMinds commentedReroll.
@Mohit Malik are you sure you were applying the patch to the latest version of 8.6.x?
Comment #107
Sutharsan CreditAttribution: Sutharsan at LimoenGroen commentedPatch applies on 8.6.x.
Comments from #95 have not been addressed. Note the typo is in "\Druapl"
Comment #108
Sutharsan CreditAttribution: Sutharsan at LimoenGroen commentedI think this went wrong in the reroll.
field_uninstall_validator
was not part of previous patches.Comment #109
mohit1604 CreditAttribution: mohit1604 at Google Summer of Code commentedComment #110
mohit1604 CreditAttribution: mohit1604 at Google Summer of Code commented@Sutharsan , Thanks for reviewing the patch . Did required changes and attached interdiff against patch #101 :)
Comment #111
mohit1604 CreditAttribution: mohit1604 at Google Summer of Code commentedComment #113
Sutharsan CreditAttribution: Sutharsan commentedUnfortunately the patch still does not apply.
My first comment about "@deprecated in Drupal 8.4.x" has not yet been addressed. Pls change to 8.6.x.
Comment #114
Sutharsan CreditAttribution: Sutharsan commented@Mohit Malik, you are working from an old 8.6.x version. Your patch contains:
The last line (arguments: ...) changed in 24/01/2018.
Always create a patch from the HEAD of the applicable branch (git pull / git rebase). See https://www.drupal.org/node/707484 for more info about making patches.
Comment #115
jofitz CreditAttribution: jofitz at ComputerMinds commentedComment #117
jofitz CreditAttribution: jofitz at ComputerMinds commentedCatastrophic test failure!
Correction in core.services.yml
Comment #119
jofitz CreditAttribution: jofitz at ComputerMinds commentedCorrect a few more tests.
Comment #121
BerdirA rebase and fixed the shared tempstore deprecation thing, was incorrectly merged.
This will still need a lot of work. A mistake that we did here was to change the order of injected services to keep the entity manager replacements together. While a nice idea, it is an unecessary BC change, all the new services should be optional constructor arguments with a fallback to \Drupal::service().
Also wondering if we should split this up as it is crazy large.
Comment #123
Sutharsan CreditAttribution: Sutharsan at LimoenGroen commentedHere at the Front-end United conference I have discussed the status of this issue with Alex Pott, because I had concerns about how to proceed to get this patch committed.
The patch size is large (250K) and Drupal core is a moving target. But the major point is that the patch contains backward compatibility (BC) breaking changes. With all in one patch, these BC-breaking changes will block simpler and easier to accept parts of the patch. Futher the changes do affects many parts of core not all of them may be discovered by tests. We should allow ample time to discover the any unforseen effects.
To addres the first point, I propose to break-up the patch along lines of BC-breaking and difficulty of committing. That will allow progress on easier parts while BC discussions can take place. The patch currently contains both BC and non-BC breaking changes. Some of the BC-breaking changes may be mittigated or (better) refactored to be non-BC breaking. Inidividual API changes require change records to be written.
Split the patch
Proposed break-down of the patch:
1. Non-BC breaking changes; Classes with only 1-on-1 replacement of EntityManager by EntityTypeManager and with no other constructor signature changes. One patch for this category.
2. Changes in test-classes that have no relation to other changes in the patch. One patch for this category. (Perhaps this category is small or non-existend.)
3. Classes with more complex constructor changes; Other BC-breaking changes. Changes that need their own decicated change record. One patch per class.
4. Changed Base class; Classed that are (frequently) inherited; Changes that are expected to raise discussion about API-change(s). One patch per class.
Schedule the patch
To have enough time to discover unforseen effects, I propose to aim for committing the non-BC breaking code (parts 1 and 2) in the window between 6.0-alpha and 6.0.0. At 6.0-alpha release (the week of July 18, 2018) the 7.0.x branch will be opened. That will provide a period of 6-7 months before core is released with this change.
Parts 3 and 4 are smaller in scope, but may take more time to discuss. These can be committed later.
On Backward Compatibility
See also the Drupal 8 backwards compatibility and internal API policy.
Constructors
Changing EntityManagerInterface to EntityTypeManagerInterface is not BC breaking. When a modified constructor is called with EntityTypeManger, it will still work.
New constructor arguments should be made optional (defaults to NULL) and the constructor should check if the argument implements the desired interface.
Protected properties
Protected properties on a class are always considered @internal and should not change between patch versions. Protected properties in base classes may not be allowed to change.
Comment #124
Mile23How about we do this one last, after we've changed all the code usages to the extent we can without changing service definitions?
There are about a zillion smaller-scope issues dealing with EntityManager deprecation.
For instance: #2691675: Replace deprecated entityManager() in ControllerBase descendents
This deprecation really needs a meta.
Comment #125
BerdirI never followed up here but I quickly discussed this in Slack as well. What I proposed there is that we do split it up, but simply by doing patch for core.services.yml and one for the module services.yml.
I'm aware that this currently has BC breaking changes including tons of constructor changes. I have no intention of getting it committed like that. Most of those things can be handled in a way that doesn't break contrib modules and that includes constructor changes. We found a way to deal with ContentEntityForm for example.
For the constructor changes, that means appending new arguments and not changing the existing order. And doing it as optional arguments.
> This deprecation really needs a meta.
IMHO that's what your own #2886622: Deprecate all EntityManager methods with E_USER_DEPRECATED kind of is.
Comment #126
BerdirTrying that, rebased and moved the changes in core/modules to #2977107: Use more specific entity.manager services in module .services.yml files.
Expecting some test fails. I already updated the entity converted services to be backwards compatible so that the one in views_ui doesn't break.
Comment #127
BerdirFixed the failing test and updated the one other service like that.
Comment #129
Mile23EntityDefinitionUpdateManager
might be complex enough of a change to need a follow-up, as in #62 and #63.It has a lot of calls to
$this->entityManager->clearCachedDefinitions();
, which it gets fromEntityTypeRepositoryInterface
, and$this->entityManager->useCaches(FALSE);
which it gets fromEntityFieldManagerInterface
So it probably needs to also inject
EntityTypeRepositoryInterface
and then use it to clear caches (if that's still a thing we do), and convert$this->entityManager->useCaches(FALSE);
to use the existing$this->entityFieldManager
.The rest is +1 because it's pretty straightforward.
Comment #130
Mile23Updated IS for scope.
Comment #131
Sutharsan CreditAttribution: Sutharsan at LimoenGroen commentedEdited
Re-rollWorking on splitting of the patch...
Sorry, did not see comments coming in. Reading...
Comment #132
Sutharsan CreditAttribution: Sutharsan at LimoenGroen commentedComment #133
Berdir@Sutharsan: Yeah, I was worried you'd be working on it, but it wasn't been assigned to you and you weren't in slack :)
@Mile23:
Yeah, that one is a bit annoying.
Since that service specifically deals with entity type and field definitions, I think it's fair to expect that we have to invalidate entity type and field definitions and also use the useCaches() method on EntityFieldManager (which is currently deprecated but seems like we might need to undeprecate that, we'll see). The bundles and entity type listener I'm not sure yet, lets see if something fails.
Kernel tests seem to pass with this, lets see. If this isn't working at all in update tests or so then we can split it off.
Comment #134
BerdirThat passed :)
Also restoring issue title & summary.
Comment #135
Mile23Thankfully, that's out of scope here. :-)
Comment #136
alexpottNeeds to trigger a deprecation message if not set.
Should throw a deprecation message if used. This one is fun to sort out...
These changes make me wonder if we should have an entityManagerProperty deprecation trait that triggers a deprecation warning and uses a magic getter. It could even be dynamic so the something like DeprecatedServicePropertyTrait and use a class property thats an array like
['entityManager', 'entity.manager']
.As far as I can see this has been removed.
Should these have the NULL thingy? And deprecations. Or is the EntityDefintionUpdateManager not API :)
This is weird. I think the trait idea up above is a better solution. As with the patch this would become public.
Comment #137
BerdirThanks for the review.
1. Well, getting a bit bigger now..
2. Added.
3. Added, also converted the calls to it.
4. Interesting idea. Lets see if this works. Like with 2, this forces us to already convert the subclasses, e.g. in views_ui as well (or add it to the skipped exceptions). This is how the message then looks (we can't be quite as helpful as with non-generic ones as we don't know about how to replace it, but it's better than a fatal):
The property entityManager (entity.manager service) is deprecated in Drupal\Core\ParamConverter\EntityConverter and will be removed before Drupal 9.0.0.
5. Yep.
6. Well. It makes sense to be as nice as possible on classes that are likely candidates for replacements/subclasses. I don't think this is one of them. We certainly haven't done it before, especially the EntityConverter class history (which actually is being subclassed quite a bit) was a mess, cleaned it up a bit but only added deprecation messages for entity manager related changes. It does result in quite a bit of cruft though.
7. Well, actually, __get() must be public, so this doesn't change anything. And we still need to trigger a deprecation message. But updated with the trait.
Comment #139
effulgentsia CreditAttribution: effulgentsia at Acquia commentedTagging for tracking per #2949018-10: [policy, no patch] Make removal of deprecated usages a feature release blocker. Please correct me if there's a different tag we should use for this.
Comment #140
BerdirReroll. I'd love to finally get this in, it frequently conflicts, for example most recently with #2976103: Make it possible to retrieve all the last installed entity type definitions at once from the update manager which injected one of the several needed dependencies into EntityDefinitionUpdateManager.
@effulgentsia: Yeah, that tag make sense, also commented over there. This itself and various other issues is part/prerequisite of #2886622: Deprecate all EntityManager methods with E_USER_DEPRECATED.
Comment #141
BerdirComment #142
Mile23Soooo close...
This needs its own CR, so we can tell people how to use it, which means adding the URL to the logic exception message.
Comment #143
amateescu CreditAttribution: amateescu for Pfizer, Inc. commentedI think we need to change these messages to mention 8.7.0 instead.
Isn't this just the config factory? Without the "entity" part :)
We could remove these blank newlines.
Don't we usually put these on multiple lines?
This sentence sounds a bit weird around
EntityConverter::__construct()
andrequired
.Comment #144
jofitz CreditAttribution: jofitz at ComputerMinds commentedAddressed comments in #143.
Still requires CR.
Comment #145
BerdirCreated https://www.drupal.org/node/3002321, not sure that a link to that belongs into the exception, don't think I've ever seen that done?
Comment #146
amateescu CreditAttribution: amateescu for Pfizer, Inc. commentedAgreed with #145, I think this looks ready now.
Comment #148
kristiaanvandeneyndeMinor nitpick: Why not use $entity_last_installed_schema_repository as that one remains unchanged and is passed in both pre- and post-patch?
Comment #149
BerdirNot sure I follow, it was there before but it was also optional already then. That additional option argument was added in 8.6 and conflicted in a recent reroll. It's only there because the previous BC approach was different, it always set the variable instead of assigning it, but I removed that part, so it actually isn't guaranteed to be set anymore.
Comment #150
kristiaanvandeneyndeSets the last installed schema repository both before and after the patch.
Here, the optional-because-of-BC variable is populated when left out.
But here, that deprecation notice is gone and we assume people did not pass the repository if they are still passing the old entity manager. A fair assumption to make, but it seems safer to keep both deprecation warnings?
Edit: I'm thinking of the outside chance someone updated their code after 8.6.0 to properly pass in the repository and now they are not seeing the passed in repository being used because it is replaced with the one from the container. Very much an edge case so feel free to handle this whichever way your judgement tells you to.
Comment #151
catchAgreed with @kristiaanvandeneynde , we can compare the hunk above to how EntityConverter is doing it:
So I think EntityDefinitionUpdateManager should follow the same pattern as here - i.e. separate variable checks and deprecation messages.
Otherwise this looks great.
Comment #152
amateescu CreditAttribution: amateescu for Pfizer, Inc. commentedAgreed with #150/#151. A few of my patches depend on this one, so here's a quick update which implements #151.
Comment #153
kristiaanvandeneyndeA bit overly verbose but I guess that's the whole idea with these deprecation notices :) Looks good to me now!
That said, I went over the other constructors again just to make sure we are fully BC and I think there are quite a few which need the same treatment. If I'm wrong, feel free to go right back to RTBC!
ConfigManager is not marked as internal. So don't we need to add the deprecation notice here as well? And use the DeprecatedServicePropertyTrait?
This will still allow people to pass an entity manager as both managers have a getStorage() method, but I guess that's fine? Or do we need to throw a deprecation notice as well here?
ContentUninstallValidator isn't internal, so do we need to throw a warning here too? And use the DeprecatedServicePropertyTrait?
EntityCreateAccessCheck isn't internal, so same comment re warning and trait.
EntityFormBuilder isn't internal, so same comment re warning and trait.
EntityResolverManager isn't internal, so same comment re warning and trait.
BundleConfigImportValidate isn't internal, so same comment re warning and trait.
HtmlEntityFormController isn't internal, so same comment re warning and trait.
QueryFactory isn't internal, so same comment re warning and trait.
EntityRouteProviderSubscriber isn't internal, so same comment re warning and trait.
MenuParentFormSelector isn't internal, so same comment re warning and trait.
Comment #154
BerdirHa, that was very thorough :p At least that stuff can mostly be copy & pasted.
2. Left it at that. At some point, we'll add a @trigger_error to all entity manager methods, if someone really still passes entity.manager, then it will do a deprecation message then.
9. QueryFactory is completely deprecated, not bothering to add another a check there, it will go away and if someone still uses that then they already get deprecation messages. Did add the trait through to be extra thorough.
Added both the constructor check and the trait everywhere else.
Comment #155
amateescu CreditAttribution: amateescu for Pfizer, Inc. commentedLooks great :)
Comment #156
kristiaanvandeneyndeAgreed, sorry for having so many nitpicks at the eleventh hour :D
Comment #157
catchCommitted ac63952 and pushed to 8.7.x. Thanks!
Comment #159
catchComment #160
Wim LeersPublished the CR.
Comment #161
Wim LeersUpdated
jsonapi
to fix the deprecation warnings: #3006743: Follow-up for #2624770: EntityConverter service requires additional parameters since Drupal core 8.7. Updated it in such a way that there will not be future deprecation warnings.