Updated: Comment 0

Problem/Motivation

We do have the request stack.

Proposed resolution

Let's use it.

Remaining tasks

User interface changes

API changes

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

dawehner’s picture

Status: Active » Needs review
FileSize
3.76 KB

Just to get some idea out.

tim.plunkett’s picture

I think it makes sense to use RequestStack in more services, but I'm curious about the places we have it bleeding through to forms themselves.

  1. +++ b/core/lib/Drupal/Core/Form/FormBase.php
    @@ -175,7 +175,7 @@ protected function getRequest() {
    +    $this->requestStack = $request;
    

    I think this needs to be $this->requestStack->push($request);

  2. +++ b/core/modules/user/lib/Drupal/user/Form/UserMultipleCancelConfirm.php
    @@ -202,7 +202,7 @@ public function submitForm(array &$form, array &$form_state) {
    +          $admin_form->buildForm($admin_form_mock, $admin_form_state, $this->requestStack);
    
    +++ b/core/modules/views_ui/lib/Drupal/views_ui/ViewEditFormController.php
    @@ -33,7 +33,7 @@ class ViewEditFormController extends ViewFormControllerBase {
        * @var \Symfony\Component\HttpFoundation\Request
    
    @@ -45,7 +45,7 @@ class ViewEditFormController extends ViewFormControllerBase {
    +    $this->requestStack = $request;
    
    @@ -288,7 +288,7 @@ public function submit(array $form, array &$form_state) {
    +    $query = $this->requestStack->query;
    
    @@ -761,7 +761,7 @@ public function renderDisplayTop(ViewUI $view) {
    +    $query = $this->requestStack->query;
    

    I don't think any of these are right...

dawehner’s picture

Yeah don't drink and patch.

jhedstrom’s picture

Status: Needs review » Needs work
Issue tags: +Needs reroll
Nitesh Sethia’s picture

Status: Needs work » Needs review
FileSize
4.43 KB

Rerolling the patch as per the latest D8 release.

Status: Needs review » Needs work

The last submitted patch, 5: make_use_of_the_request-2211617-5.patch, failed testing.

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, 5: make_use_of_the_request-2211617-5.patch, failed testing.

Miguel.kode’s picture

Status: Needs work » Needs review
FileSize
4.44 KB

It is a re-roll for this patch.

Status: Needs review » Needs work

The last submitted patch, 9: make_use_of_the_request-2211617-6.patch, failed testing.

nesta_’s picture

Status: Needs work » Needs review
FileSize
1.07 MB

rerolled.

Status: Needs review » Needs work

The last submitted patch, 11: make_use_of_the_request-2211617-11.patch, failed testing.

nesta_’s picture

Status: Needs work » Needs review
FileSize
3.76 KB

Sorry, this Rerolled for #1

Status: Needs review » Needs work

The last submitted patch, 13: request_stack-2211617-1.patch, failed testing.

uzlov’s picture

request stack (all this) already exist in 8.1.x
+ here old code (for example ViewEditFormController alredy changed to ViewEditForm)
need to close it issue

uzlov’s picture

Status: Needs work » Closed (outdated)