Closed (fixed)
Project:
Drupal core
Version:
8.0.x-dev
Component:
plugin system
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
26 Jun 2013 at 11:04 UTC
Updated:
29 Jul 2014 at 22:34 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
dawehnerThis doesn't seem to be needed but yeah I don't care.
I guess we should use the ViewStorageControllerInterface?
What a big amount of work for just this single change
Comment #2
damiankloip commentedWe don't have one of those do we? We have ViewStorageInterface, but not for controllers iirc.
It looks like alot for this small change, but almost all Derivative classes need to get something injected (and are using procedural functions) at the moment. I don't mind doing that here or in a follow up though. Whichever we think is easier. If we get this in the the others are just conversions I guess.
Comment #3
damiankloip commentedok, I spoke to Eclipse on IRC, and he likes the other approach here; Allow the derivative key to be a service name. So let's try that.
Comment #4
eclipsegc commentedOther than the fact that we're injecting the EntityManager when we actually need
Seems odd that we're getting the entity manager when what we actually need is the view storage controller, but perhaps this is just how it is right now. Otherwise this looks great to me.
Comment #5
damiankloip commentedYep, I'm afraid that has to go through the entity manager.
Comment #6
eclipsegc commentedThis needs tests, and then I'd be happy to rtbc it.
Eclipse
Comment #7
neclimdulI was pretty certain when I first skimmed the patches but now I'm a little torn. I think I much prefer the former patch over the later. It feels like it would provide a little more flexibility and I'm dubious of the utility of providing the fetcher as a service. It seem like an entirely internal object that is neither useful to other implementations or particularly swapable.
The downside though is it makes the fetcher slightly less testable because the actual used services are embedded in the container. So we're not really doing the best form of injection here.
Comment #8
eclipsegc commentedneeds work either way.
Eclipse
Comment #9
dawehnerMy review on #1 was odd/
Added some tests
Comment #11
damiankloip commentedGreat work, thanks for the tests!
We now need to use loadMultiple() instead of load() to get all entities, that's the only reason for those failures I think. I also added a little bit more to the unit test, to also mock the container and test that get is called for our example service. Atleast it lets us know that hte container is passed into our fetcher ok.
Comment #12
dawehnerNice addition.
Comment #13
eclipsegc commentedI'm generally ++ to this and am also RTBC. I might caution that we probably shouldn't re-invent the ContainerInterface stuff over and over and over again for different use cases, considering it's the same thing all the time. But that seems like a general followup for all of core, not Derivatives specific.
Seconding the RTBC
Eclipse
Comment #14
alexpottCommitted bd51e51 and pushed to 8.x. Thanks!
Comment #15.0
(not verified) commentedUpdated issue summary.