Problem/Motivation
Currently the current $request is passed into parameter converters convert() method. However, not one in core actually depends on the request.
The dependency of the paramater converter service on the request is one of the reasons why it is currently necessary to prepare a fake request when executing access-checks on arbitrary routes.
Proposed resolution
Remove the request from parameter converters and get one step closer to removing the fake-request hack in AccessManager::checkNamedRoute() as well as the RequestHelper::duplicate() method.
Remaining tasks
User interface changes
API changes
Before: ParamConverterInterface::convert($value, $definition, $name, array $defaults, Request $request)
After: ParamConverterInterface::convert($value, $definition, $name, array $defaults)
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | 2330929-remove-request-from-parameter-converters.patch | 16.86 KB | znerol |
Comments
Comment #1
znerol commentedComment #2
dawehnerNice is really lovely. I kind of consider this to be RTBC already
Comment #3
znerol commentedUpdated the change record and added more background information to the issue summary.
Comment #4
dawehnerWell, there are also handbook pages etc.
Comment #5
znerol commentedI found this one: https://www.drupal.org/node/2310427 is there example-code somewhere?
Comment #6
catchCommitted/pushed to 8.0.x, thanks!