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)

Comments

znerol’s picture

Status: Active » Needs review
StatusFileSize
new16.86 KB
dawehner’s picture

Nice is really lovely. I kind of consider this to be RTBC already

znerol’s picture

Issue summary: View changes
Issue tags: -Needs change record updates

Updated the change record and added more background information to the issue summary.

dawehner’s picture

Status: Needs review » Reviewed & tested by the community

Well, there are also handbook pages etc.

znerol’s picture

I found this one: https://www.drupal.org/node/2310427 is there example-code somewhere?

catch’s picture

Status: Reviewed & tested by the community » Fixed

Committed/pushed to 8.0.x, thanks!

  • catch committed 12feabd on 8.0.x
    Issue #2330929 by znerol: Remove the request from parameter converters.
    

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.