In a controller I send a
Response
and have a fallbackRedirectResponse
if that or other things didn't work; also because a controller needs to return some sort of response. For some reason this didn't work anymore and I got the described error message.
With the following changes it worked:Old:
try { $service->getResponse($destination, $langcode)->send(); catch { // ... } return new RedirectResponse($destination, 302);
New:
try { $response = $service->getResponse($destination, $langcode); return new Response($response->getContent(), $response->getStatusCode(), $response->headers->all()); catch { // ... } return new RedirectResponse($destination, 302);
PS: I couldn't return the Response directly because it was a
TrustedRedirectResponse
with an external link which caused whole bunch of other problems.- 🇫🇷France bertrandl
Hello,
From today, I get this error during Drupal 10.4.1 install process : https://mysite.local/core/install.php?langcode=en&profile=standard
My config :
OS : Linux deb-win 6.1.0-27-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.115-1 (2024-11-01) x86_64 GNU/Linux
nginx/1.22.1
Drupal Version 10.4.1
PHP Version 8.2.25
Some previous installation with same context are always OK