Problem/Motivation

On a base Drupal 11 install, when navigating to /big_pipe/no-js?destination= a 500 error occurs

The website encountered an unexpected error. Try again later.

InvalidArgumentException: Cannot redirect to an empty URL. in Symfony\Component\HttpFoundation\RedirectResponse->setTargetUrl() (line 68 of /var/lib/tugboat/stm/vendor/symfony/http-foundation/RedirectResponse.php).
Drupal\Component\HttpFoundation\SecuredRedirectResponse->setTargetUrl('') (Line: 39)
Symfony\Component\HttpFoundation\RedirectResponse->__construct('') (Line: 53)
Drupal\big_pipe\Controller\BigPipeController->setNoJsCookie(Object)
call_user_func_array(Array, Array) (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->{closure:Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber::wrapControllerExecutionInRenderContext():121}() (Line: 638)
Drupal\Core\Render\Renderer::{closure:Drupal\Core\Render\Renderer::executeInRenderContext():638}()
Fiber->start() (Line: 639)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 121)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->{closure:Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber::onController():96}() (Line: 183)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 76)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 53)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 30)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 28)
Drupal\Core\StackMiddleware\ContentLength->handle(Object, 1, 1) (Line: 32)
Drupal\big_pipe\StackMiddleware\ContentLength->handle(Object, 1, 1) (Line: 118)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 92)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 71)
Drupal\Core\StackMiddleware\AjaxPageState->handle(Object, 1, 1) (Line: 54)
Drupal\Core\StackMiddleware\StackedHttpKernel->handle(Object, 1, 1) (Line: 753)
Drupal\Core\DrupalKernel->handle(Object) (Line: 34)
Symfony\Component\Runtime\Runner\Symfony\HttpKernelRunner->run() (Line: 32)
require('/var/lib/tugboat/stm/vendor/autoload_runtime.php') (Line: 22)
require_once('/var/lib/tugboat/stm/web/autoload_runtime.php') (Line: 13)

Steps to reproduce

Proposed resolution

Checking for an empty destination should resolve this issue.

Issue fork drupal-3616298

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

realgt created an issue. See original summary.

realgt’s picture

StatusFileSize
new1.04 KB

11.4.x patch to resolve issue attached.

realgt’s picture

StatusFileSize
new1.04 KB

fixed issue with first patch

realgt’s picture

StatusFileSize
new1.04 KB

fixed trailing line in patch

cilefen’s picture

Status: Active » Needs work
Issue tags: -BigPipe +Needs merge request, +Needs tests

Thank you for the code. This needs a merge request to proceed. It also needs a test, which could go in core/modules/big_pipe/tests/src/Functional/BigPipeTest.php

realgt’s picture

StatusFileSize
new1.04 KB

having issues with applying patch on 11.4.4, rerolling

realgt’s picture

StatusFileSize
new1.19 KB

attaching a test patch to check correct handling of an empty destination parameter.

cilefen’s picture

The automated test system only triggers on merge requests, so please open one now.