Closed (fixed)
Project:
Drupal core
Version:
8.0.x-dev
Component:
routing system
Priority:
Major
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
13 Jun 2015 at 14:57 UTC
Updated:
19 Jul 2015 at 15:34 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
pwolanin commentedFirst pass to see what tests fail.
Comment #4
willzyx commentedComment #6
pwolanin commentedremaining work is pretty novice - needs fixes in 2 test classes.
Comment #7
jcloys commentedWorking on the test.
Comment #8
jcloys commentedComment #9
larowlanThis is a performance boost too, less calls to the static
Comment #10
pwolanin commentedMinor - missed the variable name in @param
Comment #11
kgoel commentedI applied the patch, and looked at the patch in PhpStorm. I had a question about injected service into the LinkGenerator constructor and pwolanin said it's not considered as an API change and it wont break BC.
#9 stated that it would improve performance so I am doing next. I will post performance result shortly.
Comment #13
dawehnerAt some point we need to talk about that. Its worth to see the talk fabpot about the deprecation note, its never as easy as you think.
For now though, this is certainly the right thing to do, especially given how you would override the link generator.
Comment #14
wim leersA bunch of nits. I'd feel bad for un-RTBC'ing it, but the beta evaluation is missing here too. Plus, it's an easy fix.
Nit: we usually write "The renderer."
Nit: The middle line can be deleted.
Comment #15
joshi.rohit100Comment #16
wim leersYou can omit the "service" but, but that'd be okay too.
Now let's add the beta evaluation still.
Comment #17
pwolanin commentedComment #18
pwolanin commentedadded beta eval
Comment #19
dawehnerLet's get it in, we have all we need.
Comment #21
xjmSo, #2393329: Replace all drupal_render calls with the service, and inject it, if possible. was postponed to 8.1.x, and we also agreed there to make all these changes in one single patch rather than in dozens of small issues. It'd be good going forward to keep in mind the recommendation made on the parent issue, and also note the part of the beta policy prioritized changes that says:
(Emphasis added.)
drupal_render() is deprecated for 9.0.0.
However, since this keeps coming up with regard to
drupal_render()in particular, I discussed this more with @Wim Leers and @berdir to understand the importance. @Wim Leers said that replacing a use of the static service call (whichdrupal_render()wraps) with an injected service does actually make a noteworthy performance difference relative to that bit of code, and since LinkGenerator is very much in the critical path, this issue in partiular is worth treating as a performance improvement.In general, however, replacing code deprecated for 9.x is not a prioritized change during the beta, nor is general refactoring for dependency injection. Please help communicate this on other issues that you see in the queue along those lines.
So this patch individually is a good improvement during the beta. I'll follow up more on #2393329: Replace all drupal_render calls with the service, and inject it, if possible. (basically, replacing it with an injected service in frequently used code is worthwhile, but simply converting the procedural call to a static method call isn't really in scope for the beta). Thanks everyone for your work here! Committed and pushed to 8.0.x.
Comment #22
xjm(Note that I reverted and re-committed this to add proper reviewer credit.)
Comment #24
xjm