Closed (fixed)
Project:
Drupal core
Version:
8.5.x-dev
Component:
rest.module
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
10 Jan 2018 at 21:20 UTC
Updated:
15 Feb 2018 at 14:39 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
larowlanI might be making this up
Comment #3
wim leersSo: you're saying that
handle()should haveRestResourceConfigInterface $rest_resource_configas one of its parameters, and then the routing system should do the upcasting automatically. Correct?EDIT: cross-posted — looks like that is what @larowlan meant.
Comment #4
wim leersOh, even without the upcasting!
Comment #5
larowlanWe might need a named slug for this to work, we'll see. Could be dreaming this up.
If it works, would be interested to see if we could make it use the entity converter too by setting the needed options, then we can avoid the ::load
Comment #6
wim leersLove the thinking, doubt it works, would love to be wrong, will check in the morning!
Comment #8
larowlanso it works, next step, adding the entity type options and making it use the actual config entity
Comment #9
wim leersWoahhhhh! TIL. 👌
Comment #10
wim leersOnly fixed a docs nit.
So this doesn't do upcasting, but it does mean there's no more need to inspect the route match's matched route object just to read a route default. Still a win :) One LoC less!
Comment #11
wim leersOops.
Comment #12
larowlani think we can do better, will need to update the kernel test still (doesn't include #10 yet)
Comment #14
wim leers#12 is what I thought you originally meant, and what I thought that couldn't work.
Looks like it doesn't. 100% of REST integration tests fail with:
Comment #15
larowlanMessed up #12
Comment #16
larowlanthis was my mistake
Comment #18
larowlanwinning
Comment #19
larowlansweet
Comment #20
wim leersVery happy to be wrong! 😀
And great to have an example in core of how to get a route default to be upcasted!
Only bringing back my nitpick fixes from #10, then this is RTBC.
Comment #23
larowlanl.d.o http transfer issues
Comment #24
wim leersIndeed! Retesting…
Comment #25
catchJust saw this yesterday and thought it looked a bit clunky, then saw this issue today.
Committed/pushed to 8.6.x and cherry-picked to 8.5.x. Thanks!
Comment #28
catch