Problem/Motivation

From https://www.drupal.org/project/drupal/issues/2976394#comment-12938274

Drupal\Tests\field\Functional\Hal\FieldConfigHalJsonCookieTest::testGet
Exception: TypeError: Argument 1 passed to Symfony\Component\HttpFoundation\Response::setCharset() must be of the type string, null given, called in /var/www/html/core/modules/rest/src/EventSubscriber/ResourceResponseSubscriber.php on line 210
Symfony\Component\HttpFoundation\Response->setCharset()() (Line: 496)

Drupal\Tests\action\Functional\ActionListTest::testEmptyActionList
Exception: TypeError: Argument 1 passed to Symfony\Component\HttpFoundation\Response::setCharset() must be of the type string, null given, called in /var/www/html/core/lib/Drupal/Component/HttpFoundation/SecuredRedirectResponse.php on line 43
Symfony\Component\HttpFoundation\Response->setCharset()() (Line: 496)

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

Comments

catch created an issue. See original summary.

catch’s picture

Status: Active » Needs review
StatusFileSize
new156.63 KB
new871 bytes

This might be all we need to do.

gábor hojtsy’s picture

Status: Needs review » Needs work

There is also the same fail in ResourceResponseSubscriber.php as in the paste :) There does not seem to be other affected code. Full output:

$ git grep "setCharset("
core/lib/Drupal/Component/HttpFoundation/SecuredRedirectResponse.php: $this->setCharset($response->getCharset());
core/modules/rest/src/EventSubscriber/ResourceResponseSubscriber.php: $final_response->setCharset($response->getCharset());
core/tests/Drupal/Tests/Component/HttpFoundation/SecuredRedirectResponseTest.php: $redirect->setCharset('ibm-943_P14A-2000');

gábor hojtsy’s picture

Status: Needs work » Needs review
StatusFileSize
new157.6 KB
new1.83 KB
new1002 bytes

There you go.

The last submitted patch, 2: 3027835-combined.patch, failed testing. View results

The last submitted patch, 4: 3027835-4-combined.patch, failed testing. View results

alexpott’s picture

Status: Needs review » Reviewed & tested by the community

Looks good to me. Can't see any downsides.

larowlan’s picture

Status: Reviewed & tested by the community » Fixed

Committed db42557 and pushed to 8.7.x. Thanks!

  • larowlan committed db42557 on 8.7.x
    Issue #3027835 by Gábor Hojtsy, catch: [symfony 4]  Argument 1 passed to...

Status: Fixed » Closed (fixed)

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