Closed (fixed)
Project:
Drupal core
Version:
8.2.x-dev
Component:
entity system
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
11 Feb 2016 at 10:04 UTC
Updated:
30 Mar 2016 at 20:34 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
dawehnerComment #3
dawehnerComment #5
dawehnerDoes this help?
Comment #7
dawehnerThank you bojanz!
Comment #8
wim leersLooks good, but I'd feel better if somebody with better routing system knowledge would review/RTBC this.
Why not use this for the node revision routes?
Nit: Shouldn't it be singular here?
Nit: can be removed, this is never used.
Comment #9
dawehnerThank you for your review!
Well, every change there is a potential API break. What if someone replaced the service and extended the existing class? Given that is hard to remove anything. This issue is also NOT about making the life of node easier, but rather to enable contrib and custom modules to not get insane.
Good point
Comment #10
wim leersHow can we then ever let core use improved APIs?
Comment #11
dawehnerFor contrib / custom usages there aren't any problems. Node module is a mess, I don't see that much hope there. We can have that discussion in another issue though, this is for sure, but I just fear from a API breakage point of view this could be required to stay around.
Comment #12
bojanz commentedThe code in general is solid.
The only nitpick I have is that the param converter could have more docs. Look at the Entity param converter:
That provides a nice example to follow.
Comment #13
dawehnerSure, here it is.
Comment #14
berdirLooks good to me. Agreed on not converting node here. We can still do that later on if we want to and keep the existing class as @deprecated if anyone extends from it or something.
Comment #15
wim leers+1. But can we file a follow-up to update
node.moduleto use this new parameter converter & route enhancer?Comment #16
dawehner#2678492: Convert the node revision converter to the generic entity one
Comment #17
wim leersThanks!
Comment #18
tim.plunkettNone of this should hold up commit.
Missing leading slash
path: /foo/{entity_example_revision}Should probably have
, 2just 'causeContains doesn't match the namespace. (though aren't we getting rid of that?)
I would have put these three in a dataProvider
Comment #19
dawehnerGood points, let's fix them.
Yeah, this happens if you copy from
\Drupal\Core\ParamConverter\EntityConverterNo idea, at which point its fine in core.
Comment #20
amateescu commentedSuper minor point that can be fixed on commit:
For consistency with the code example below, this should have a leading slash as well :)
Otherwise the patch looks great to me as well.
Comment #22
catchCommitted/pushed to 8.2.x and cherry-picked to 8.1.x. Thanks! Let's do the follow-up for 8.2.x.
Added review credit post-commit.
Comment #25
berdirUh, I think we missed a tiny little detail here? :)
Actually registering this new service in core.services.yml. Found while trying to make https://github.com/fago/entity/pull/38 work.
Also, looking at this again, not sure why this was added in the Routing namespace and not in Entity/Routing, like the standard entity routing enhancer?
Comment #26
berdirOpened #2688668: Register the new entity revision param enhancer/converter as services.