Closed (fixed)
Project:
Drupal core
Version:
8.7.x-dev
Component:
entity system
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
21 Mar 2016 at 17:10 UTC
Updated:
22 Jan 2019 at 09:44 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
dawehner#2624770: Use more specific entity.manager services in core.services.yml seems to do a lot of it already ...
Comment #4
20th commented@dawehner
You are right, the patch in #2624770: Use more specific entity.manager services in core.services.yml already updates a lot of deprecated code, but it is focused specifically on services definitions and constructors and it is already enormous… And at the moment of this writing, needs a very big rebase.
On the contrary, this issue can focus specifically on usages of deprecated
entityManager()method in controller classes, which is very common across all modules in core.Comment #5
dawehnerThank you for adding a good scope for this issue. Good point! Let's focus on this one thing here. This makes it easy to review and by that actually its doable to get in. Sorry for my previous comment.
Comment #6
20th commentedComment #9
mile23I think that's all of them...
I added a follow-up #2914956: Remove usages of EntityManager from EntityViewController because NodeController uses NodeViewController to render some output.
Comment #13
berdirReroll, fixing the quickedit controller and also converting one more example from book.module.
I think it makes sense to deal with Node/EntityViewController in here too, it's easy to update and backwards compatible for sub-classes (once we add the new trait, which I'll do in the next update). Then we can add a @trigger_error() to ControllerBase::getEntityManager()
Comment #15
berdirFixed that.
Comment #17
berdirActually fixing the quickedit controller.
Comment #18
berdirReroll, updating BC handling.
Comment #20
berdirAdded missing constructor argument.
Comment #21
larowlanLooks good to me
Comment #22
berdirthis is wrong. apparently this method is not actually called in core.
Comment #23
berdirthis should fix that.
Comment #24
larowlanGood catch
Can you open an issue for removing it/finding out what title callback is used on that route?
Comment #25
berdirThe title callback does point to that method, but that specific route sets a #title (through EntityViewBuilder); so going to that URL does not have to call the title callback. And nothing references that route in a way that requires us to resolve the title through the callback (e.g. breadcrumb), not in core anyway, so it's never called.
It possibly was called at some point, but then EntityViewController was refactored to set the #title through the render-trickery, so that quickedit works. Note that it actually can work on the preview page :)
So, not quite sure what to do about that..
Comment #26
berdirCreated #3024386: Deprecate NodePreviewController::title
Comment #27
alexpottI would turn these around to be
Because then in the future when we remove the deprecation we have less change to make and less code moves... i.e. we can remove the entire if and the
= NULLfrom the constructor and we are done.There might be a compelling reason to do it the way round @Berdir has - if there is I'm +1 for re-rtbc :)
Comment #28
berdirI don't have a reason, I think I copied that pattern in #2624770: Use more specific entity.manager services in core.services.yml from somewhere. Will have to update a lot of cases for that, but there are worse things ;)
Comment #29
berdirUpdated that, also realized I missed one controller when adding the BC changes, changed that now to just use entityTypeManager() like it used entityManager() before.
Comment #30
alexpottThanks for the quick fixes. Marking rtbc as the changes are minimal. I've review all the service names in the deprecated code paths and they look good.
Comment #31
alexpottCommitted c23c05c and pushed to 8.7.x. Thanks!
Comment #32
alexpott