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.
| Comment | File | Size | Author |
|---|---|---|---|
| #7 | big_pipe_fix_empty_destination_test.patch | 1.19 KB | realgt |
| #6 | big_pipe_fix_empty_destination.patch | 1.04 KB | realgt |
Issue fork drupal-3616298
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
Comment #2
realgt commented11.4.x patch to resolve issue attached.
Comment #3
realgt commentedfixed issue with first patch
Comment #4
realgt commentedfixed trailing line in patch
Comment #5
cilefen commentedThank 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.phpComment #6
realgt commentedhaving issues with applying patch on 11.4.4, rerolling
Comment #7
realgt commentedattaching a test patch to check correct handling of an empty destination parameter.
Comment #8
cilefen commentedThe automated test system only triggers on merge requests, so please open one now.