Problem/Motivation

Following all the work in #3055180: [META] Symfony 5 compatibility, update the Drupal 10 branch to Symfony 5.

Proposed resolution

Update to Symfony 5 on the Drupal 10 branch once its open for development.

Remaining tasks

Do it.

User interface changes

None.

API changes

TBD

Data model changes

TBD

Release notes snippet

Drupal 10 was upadated to Symfony 5.4 as a stepping stone to Symfony 6. The change will be released with alpha1 as an interim step to help contributed projects update to Symfony 6. While direct Symfony API use is not common in Drupal projects, this interim step was introduced to help those who use Symfony APIs directly to be able to check for deprecated APIs in two steps. Since Symfony 4 does not have all deprecated APIs defined for Symfony 6, this interim step could help identify code changes required.

CommentFileSizeAuthor
#68 interdiff-61-68.patch5.73 KBTaran2L
#68 3197482-68.patch141.19 KBTaran2L
#61 3197482-61.patch135.22 KBlongwave
#56 interdiff.3197482.55-56.txt8.78 KBlongwave
#56 3197482-56.patch132.57 KBlongwave
#55 3197482-55.patch132.68 KBlongwave
#53 3197482-53.patch179.87 KBlongwave
#47 interdiff_44-47.txt1.39 KBmurilohp
#47 3197482-47.patch144.03 KBmurilohp
#44 3197482-44.patch142.51 KBlongwave
#41 3197482-41.patch123.15 KBlongwave
#34 3197482-34.patch230.62 KBlongwave
#31 3197482-31.patch208.08 KBlongwave
#30 3197482-30.patch122.64 KBlongwave
#28 3197482-28.patch123.48 KBSpokje
#24 3197482-24.patch121.78 KBSpokje
#24 interdiff-22_24.txt4.5 KBSpokje
#22 interdiff-21_22.txt9.5 KBSpokje
#22 3197482-22.patch122.27 KBSpokje
#21 interdiff-19_21.txt4.32 KBSpokje
#21 3197482-21.patch113.22 KBSpokje
#20 3197482-20.patch113.04 KBSpokje
#20 interdiff-19_20.txt4.14 KBSpokje
#19 interdiff-17_19.txt5.23 KBSpokje
#19 3197482-19.patch108.09 KBSpokje
#17 3197482-17.patch103.34 KBlongwave
#14 3197482-14.patch102.2 KBlongwave
#11 3197482-11.patch101.25 KBlongwave
#10 3197482-9.patch100.58 KBlongwave
#8 3197482-8.patch93.48 KBlongwave
#6 3197482-6.patch13.22 KBcatch

Issue fork drupal-3197482

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:

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Gábor Hojtsy created an issue. See original summary.

Gábor Hojtsy’s picture

xjm’s picture

catch’s picture

One of the issues under discussion in #3197483: Evaluate the potential update of Drupal 10 to Symfony 6 and do it if possible is how to enable contrib testing against Symfony 5 as well as Symfony 6. While there are various ways to do this, one way is to update to Symfony 5.4 (or a beta/rc) as soon as it's available in Drupal 9, so that there is at least a branch available to run tests against.

catch’s picture

Most things from #3161889: [META] Symfony 6 compatibility can be done before (or in a couple of cases, after) we update to Symfony 5, but the MimeTypes change will have to be part of the same commit - we've already implemented a forwards compatibility layer so it's just switching things around.

-%A  The "Symfony\Component\HttpFoundation\File\MimeType\MimeTypeGuesser" class is deprecated since Symfony 4.3, use "Symfony\Component\Mime\MimeTypes" instead.
-%A  The "Symfony\Component\HttpFoundation\File\MimeType\FileBinaryMimeTypeGuesser" class is deprecated since Symfony 4.3, use "Symfony\Component\Mime\FileBinaryMimeTypeGuesser" instead.
-%A  The "Symfony\Component\HttpFoundation\File\MimeType\FileinfoMimeTypeGuesser" class is deprecated since Symfony 4.3, use "Symfony\Component\Mime\FileinfoMimeTypeGuesser" instead.
-%A  Drupal\Core\File\MimeType\MimeTypeGuesser::guess() is deprecated in drupal:9.1.0 and is removed from drupal:10.0.0. Use ::guessMimeType() instead. See https://www.drupal.org/node/3133341
-%A
+  Drupal\Core\File\MimeType\MimeTypeGuesser::guess() is deprecated in drupal:9.1.0 and is removed from drupal:10.0.0. Use ::guessMimeType() instead. See https://www.drupal.org/node/3133341
catch’s picture

FileSize
13.22 KB

Here's a patch created from the *MimeType* changes in #3161889: [META] Symfony 6 compatibility so we can start keeping track of necessary simultaneous changes to core here.

longwave’s picture

Status: Postponed » Active

10.0.x branch is open, this can be done now.

longwave’s picture

Status: Active » Needs review
FileSize
93.48 KB

#6 plus update of all Symfony components to ^5.4.

Gábor Hojtsy’s picture

Title: Update Drupal 10 to depend on Symfony 5 » Update Drupal 10 to depend on Symfony 5.4
Parent issue: #3118149: [meta] Requirements for tagging Drupal 10.0.0-beta1 » #3251854: [META] Requirements for tagging Drupal 10.0.0-alpha1

Opened #3252757: Update Drupal 10 to depend on Symfony 6.0 as well for Symfony 6.0 later on. Parenting to this to the alpha.

longwave’s picture

FileSize
100.58 KB

Remove some more compatibility shims and obsolete deprecations.

longwave’s picture

FileSize
101.25 KB

...and some unused use statements.

Gábor Hojtsy’s picture

Title: Update Drupal 10 to depend on Symfony 5.4 » Update Drupal 10 to depend on Symfony 5.4 (as a stepping stone to Symfony 6, for deprecation checking support)

Making the goal of this update super-clear :D

Status: Needs review » Needs work

The last submitted patch, 11: 3197482-11.patch, failed testing. View results

longwave’s picture

FileSize
102.2 KB

Let's skip Symfony 6 deprecations for now, and resolve those once Symfony 5.4 is in 10.0.x.

longwave’s picture

I thought we had fixed all the InputBag compatibility cases, but apparently not.

longwave’s picture

Oh, so #3162016: [Symfony 6] Retrieving a non-string value from "Symfony\Component\HttpFoundation\InputBag::get()" is deprecated fixed these initially, but it was rolled back and a simpler solution put in place - but then we never went back and fixed all the calls, so they are being raised again here.

longwave’s picture

Status: Needs work » Needs review
FileSize
103.34 KB

Added deprecation skips for the InputBag changes.

Status: Needs review » Needs work

The last submitted patch, 17: 3197482-17.patch, failed testing. View results

Spokje’s picture

FileSize
108.09 KB
5.23 KB
Spokje’s picture

FileSize
4.14 KB
113.04 KB
Spokje’s picture

FileSize
113.22 KB
4.32 KB
Spokje’s picture

FileSize
122.27 KB
9.5 KB
longwave’s picture

Thanks for picking this up!

  1. +++ b/core/lib/Drupal/Component/EventDispatcher/ContainerAwareEventDispatcher.php
    @@ -88,39 +85,8 @@ public function __construct(ContainerInterface $container, array $listeners = []
         $event_name = 1 < \func_num_args() ? func_get_arg(1) : NULL;
    

    I think this needs to be the class name if not set, e.g.

    $event_name = $eventName ?? get_class($event);
    
  2. +++ b/core/lib/Drupal/Core/DependencyInjection/Compiler/MimeTypePass.php
    @@ -56,12 +51,7 @@ public function process(ContainerBuilder $container) {
    +      $consumer->addMethodCall('addMimeTypeGuesser', $arguments);
    

    Pretty sure this whole pass can go and be replaced with a TaggedServicesPass but maybe worth deferring to a followup.

  3. +++ b/core/tests/Drupal/KernelTests/Core/Routing/ExceptionHandlingTest.php
    @@ -74,7 +74,7 @@ public function testJson404() {
    +    $this->assertEquals('{"message":"No route found for \\u0022GET ' . $request->getScheme() . ':\/\/' . $request->getHttpHost() . '\\/not-found\\u0022"}', $response->getContent());
    

    Here I am pretty sure we can just say GET http://localhost/not-found as the test will always be on localhost.

  4. +++ b/core/tests/Drupal/Tests/Listeners/DeprecationListenerTrait.php
    @@ -112,16 +113,6 @@ public static function getSkippedDeprecations() {
    -      // The following Symfony deprecations are introduced in the Symfony 4
    -      // development cycle. They will need to be resolved prior to Symfony 5
    -      // compatibility.
    

    Let's keep this comment block, bump the version numbers, and move the new deprecation skips back up to here.

Spokje’s picture

FileSize
4.5 KB
121.78 KB

Addressed #23 number 1., 3. and 4.
Unsure about number 2. so blatantly ignored that for now.

Spokje’s picture

Status: Needs work » Needs review
longwave’s picture

Opened #3253048: Replace MimeTypePass with TaggedHandlersPass for #23.2.

If this is committed as-is we will also need followups to remove each of the Symfony 5 deprecations, they are on the critical path to getting to Symfony 6.

To me this is the minimal set of changes required for SF5 compatibility: we are removing SF4-specific code and BC shims mostly around the event dispatcher and MIME type guesser, but skipping new deprecation warnings introduced in the SF5 cycle.

Spokje’s picture

FileSize
123.48 KB

Reroll after #3252088: Increase Drupal::MINIMUM_PHP to 8.0.0 was committed in MR.

MR displaying on d.o. seems broken, normally a testrun would start and show on the d.o. issue.
Not here :/

Attaching diff from current state of MR for Testbot approval

catch’s picture

A lot of child issues of #3161889: [META] Symfony 6 compatibility have working patches, I had been assuming we'd get those RTBC and committed first, and then update to Symfony 5.4 here, to minimise the number of new skipped deprecations. When we skip deprecations in core, we also skip them for contrib test runs. The deprecations would still be picked up by static analysis so probably still useful to have the update, but not as useful as if they weren't skipped, and we'll likely want to do all that before 10.0.0-alpha1 anyway.

If we commit this first then remove the skipped deprecations afterwards, we're going to end up dealing with a lot of commit conflicts taking things out of the list, so it feels like it's going to be more work. Not that the list needs to be 100% empty, but if we can clear out the low hanging fruit without ever adding to it, it'll be a shorter list to work down.

longwave’s picture

A bunch of the SF6 compatibility patches went in. Rerolled #28 and removed all Symfony 5 deprecation skips, let's see what breaks.

Status: Needs review » Needs work

The last submitted patch, 31: 3197482-31.patch, failed testing. View results

longwave’s picture

longwave’s picture

Status: Needs work » Needs review
FileSize
230.62 KB

#30 plus all four child patches.

The allowEmptyString fix can't be committed separately because it triggers a different deprecation. As it's a one liner in a test I think it's fine to commit along with the SF5.4 upgrade patch.

Status: Needs review » Needs work

The last submitted patch, 34: 3197482-34.patch, failed testing. View results

Taran2L’s picture

I've checked remaining fails and most of them are more or less simple return type/@return statement descralations:

  • 24x Method "Symfony\Component\Serializer\Normalizer\NormalizerInterface::normalize()" might add "array|string|int|float|bool|\ArrayObject|null" as a native return type declaration in the future. Do the same in implementation "Drupal\serialization\Normalizer\ListNormalizer" now to avoid errors or add an explicit @return annotation to suppress this message.
  • 3x Method "Symfony\Contracts\Translation\TranslatorInterface::trans()" might add "string" as a native return type declaration in the future. Do the same in implementation "Drupal\Core\Validation\DrupalTranslator" now to avoid errors or add an explicit @return annotation to suppress this message.
  • 3x Method "Symfony\Contracts\Translation\TranslatorInterface::getLocale()" might add "string" as a native return type declaration in the future. Do the same in implementation "Drupal\Core\Validation\DrupalTranslator" now to avoid errors or add an explicit @return annotation to suppress this message.
  • 9x Method "Symfony\Component\HttpFoundation\RequestStack::getMasterRequest()" might add "?Request" as a native return type declaration in the future. Do the same in child class "Drupal\Core\Http\RequestStack" now to avoid errors or add an explicit @return annotation to suppress this message.
  • 6x Method "Symfony\Component\Routing\RequestContextAwareInterface::getContext()" might add "RequestContext" as a native return type declaration in the future. Do the same in implementation "Drupal\Core\Routing\UrlGenerator" now to avoid errors or add an explicit @return annotation to suppress this message.

From the list above (in Symfony 6):

  • Symfony\Component\Serializer\Normalizer\NormalizerInterface::normalize() still does not have native return type
  • Symfony\Contracts\Translation\TranslatorInterface::trans() and Symfony\Contracts\Translation\TranslatorInterface::getLocale() - both have a return type
  • Symfony\Component\Routing\RequestContextAwareInterface::getContext() - has a return type

Checking the thing I've found that our deprecation catching system has not spotted that:

    /**
     * Gets the master request.
     *
     * @return Request|null
     *
     * @deprecated since symfony/http-foundation 5.3, use getMainRequest() instead
     */
    public function getMasterRequest()

UPDATE: seems like update getMasterRequest() => getMainRequest() has been already committed with a shim, so I think shim needs an update too. Thus deprecation is not being triggered I think.

longwave’s picture

longwave’s picture

The RequestStack shim can be removed entirely as part of this issue I think; it has the comment

 * @todo Remove when Symfony 5.3 or greater is required.

Alternatively we can temporarily add the return type to getMasterRequest() and then delete the class later.

Taran2L’s picture

@longwave, I guess this shim should be removed within this issue

andypost’s picture

@Taran2L that's a great question to raise on #d10readiness meeting!

longwave’s picture

Status: Needs work » Needs review
FileSize
123.15 KB

Status: Needs review » Needs work

The last submitted patch, 41: 3197482-41.patch, failed testing. View results

daffie’s picture

Status: Needs work » Needs review

Since symfony/http-foundation 5.1: Retrieving a non-string value from "Symfony\Component\HttpFoundation\InputBag::get()" is deprecated, and will throw a "Symfony\Component\HttpFoundation\Exception\BadRequestException" exception in Symfony 6.0, use "Symfony\Component\HttpFoundation\InputBag::all($key)" instead.

I see this error 72 times in the testbot result page (https://www.drupal.org/pift-ci-job/2272865). Maybe we should fix #3254250: [Symfony 6] Retrieving a non-string value from "Symfony\Component\HttpFoundation\InputBag::get()" is deprecated.

longwave’s picture

Reroll, plus #3254250: [Symfony 6] Retrieving a non-string value from "Symfony\Component\HttpFoundation\InputBag::get()" is deprecated, plus one line diff to fix RequestStack:

-  public function getMasterRequest() {
+  public function getMasterRequest(): ?Request {

Status: Needs review » Needs work

The last submitted patch, 44: 3197482-44.patch, failed testing. View results

Taran2L’s picture

I think there is a new thing:

1) Drupal\Tests\user\Unit\UserAuthTest::testAddCheckToUrlForTrustedRedirectResponse
PHPUnit\Framework\MockObject\ClassIsFinalException: Class "Symfony\Component\HttpKernel\Event\ResponseEvent" is declared "final" and cannot be doubled

This code is new, added a week ago here: #3253889: `?check_logged_in=1` causes `TrustedRedirectResponse` to fail

Commit: https://git.drupalcode.org/project/drupal/-/commit/f83161f6208e777147d70...

murilohp’s picture

Thanks for bringing this new thing @Taran2L, I've reviewed the issue last week, and now the ResponseEvent class is final, so we can't mock it, I'm uploading a new patch where I instantiate the class instead.

Let's see if this test can pass now.

Thanks!

longwave’s picture

Taran2L’s picture

Was about to do the same, @murilohp

btw, running this test locally shows me an extra deprecation, which is not available on DrupalCI:

  1x: Method "Symfony\Component\HttpFoundation\Session\Storage\Proxy\AbstractProxy::getId()" might add "string" as a native return type declaration in the future. Do the same in child class "Drupal\Tests\Core\Session\FakeAbstractProxy" now to avoid errors or add an explicit @return annotation to suppress this message.
    1x in DrupalListener::endTest from Drupal\Tests\Listeners
murilohp’s picture

I'm so sorry @Taran2L, I had no idea you were about to do that, my mistake. And about the deprecation, you're right, I think we just have to add public function getId(): string on the SessionManagerTest class.

Taran2L’s picture

The aforementioned deprecation is due to running tests like this ./vendor/bin/phpunit --filter UserAuthTest

Running like this ./vendor/bin/phpunit core/modules/user/tests/src/Unit does not show it

Oh, there are even two of them:

  1x: Method "Symfony\Component\HttpFoundation\Session\Storage\Proxy\AbstractProxy::getId()" might add "string" as a native return type declaration in the future. Do the same in child class "Drupal\Tests\Core\Session\FakeAbstractProxy" now to avoid errors or add an explicit @return annotation to suppress this message.
    1x in DrupalListener::endTest from Drupal\Tests\Listeners

  1x: Method "Symfony\Component\Routing\Matcher\RequestMatcherInterface::matchRequest()" might add "array" as a native return type declaration in the future. Do the same in implementation "Drupal\Tests\system\Functional\Routing\MockMatcher" now to avoid errors or add an explicit @return annotation to suppress this message.
    1x in DrupalListener::endTest from Drupal\Tests\Listeners
longwave’s picture

We should figure out why these deprecations don't show up on DrupalCI - are there more that we aren't seeing?

longwave’s picture

Status: Needs work » Needs review
FileSize
179.87 KB

Rerolled #47 and applied #3255245-14: [Symfony 6] Revert 3231603 to use our own TranslatorInterface

$ composer-lock-diff --no-links
+------------------------------------+---------+---------+
| Production Changes                 | From    | To      |
+------------------------------------+---------+---------+
| symfony/console                    | v4.4.34 | v5.4.1  |
| symfony/debug                      | v4.4.31 | REMOVED |
| symfony/dependency-injection       | v4.4.34 | v5.4.1  |
| symfony/error-handler              | v4.4.34 | v5.4.1  |
| symfony/event-dispatcher           | v4.4.34 | v5.4.0  |
| symfony/event-dispatcher-contracts | v1.1.11 | v3.0.0  |
| symfony/http-client-contracts      | v2.5.0  | REMOVED |
| symfony/http-foundation            | v4.4.34 | v5.4.1  |
| symfony/http-kernel                | v4.4.35 | v5.4.1  |
| symfony/process                    | v4.4.35 | v5.4.0  |
| symfony/routing                    | v4.4.34 | v5.4.0  |
| symfony/serializer                 | v4.4.35 | v5.4.0  |
| symfony/translation                | v4.4.34 | v5.4.1  |
| symfony/validator                  | v4.4.35 | v5.4.1  |
| symfony/var-dumper                 | v5.4.0  | v5.4.1  |
| symfony/yaml                       | v4.4.34 | v5.4.0  |
| psr/event-dispatcher               | NEW     | 1.0.0   |
| symfony/polyfill-intl-grapheme     | NEW     | v1.23.1 |
| symfony/polyfill-php81             | NEW     | v1.23.0 |
| symfony/string                     | NEW     | v6.0.1  |
+------------------------------------+---------+---------+

+----------------------+---------+--------+
| Dev Changes          | From    | To     |
+----------------------+---------+--------+
| symfony/browser-kit  | v4.4.27 | v5.4.0 |
| symfony/css-selector | v4.4.27 | v5.4.0 |
| symfony/dom-crawler  | v4.4.30 | v5.4.0 |
| symfony/filesystem   | v4.4.27 | v5.4.0 |
| symfony/finder       | v4.4.30 | v5.4.0 |
| symfony/lock         | v4.4.33 | v5.4.1 |
+----------------------+---------+--------+

Status: Needs review » Needs work

The last submitted patch, 53: 3197482-53.patch, failed testing. View results

longwave’s picture

Status: Needs work » Needs review
FileSize
132.68 KB

Rerolled following #3255245: [Symfony 6] Revert 3231603 to use our own TranslatorInterface

+------------------------------------+---------+---------+
| Production Changes                 | From    | To      |
+------------------------------------+---------+---------+
| symfony/console                    | v4.4.34 | v5.4.2  |
| symfony/debug                      | v4.4.31 | REMOVED |
| symfony/dependency-injection       | v4.4.34 | v5.4.2  |
| symfony/error-handler              | v4.4.34 | v5.4.2  |
| symfony/event-dispatcher           | v4.4.34 | v5.4.0  |
| symfony/event-dispatcher-contracts | v1.1.11 | v3.0.0  |
| symfony/http-client-contracts      | v2.5.0  | REMOVED |
| symfony/http-foundation            | v4.4.34 | v5.4.2  |
| symfony/http-kernel                | v4.4.35 | v5.4.2  |
| symfony/mime                       | v5.4.0  | v5.4.2  |
| symfony/polyfill-ctype             | v1.23.0 | v1.24.0 |
| symfony/polyfill-iconv             | v1.23.0 | v1.24.0 |
| symfony/polyfill-intl-idn          | v1.23.0 | v1.24.0 |
| symfony/polyfill-intl-normalizer   | v1.23.0 | v1.24.0 |
| symfony/polyfill-mbstring          | v1.23.1 | v1.24.0 |
| symfony/polyfill-php80             | v1.23.1 | v1.24.0 |
| symfony/process                    | v4.4.35 | v5.4.2  |
| symfony/routing                    | v4.4.34 | v5.4.0  |
| symfony/serializer                 | v4.4.35 | v5.4.2  |
| symfony/translation                | v4.4.34 | v5.4.2  |
| symfony/validator                  | v4.4.35 | v5.4.2  |
| symfony/var-dumper                 | v5.4.0  | v5.4.2  |
| symfony/yaml                       | v4.4.34 | v5.4.2  |
| psr/event-dispatcher               | NEW     | 1.0.0   |
| symfony/polyfill-intl-grapheme     | NEW     | v1.24.0 |
| symfony/polyfill-php81             | NEW     | v1.24.0 |
| symfony/string                     | NEW     | v6.0.2  |
+------------------------------------+---------+---------+

+----------------------+---------+--------+
| Dev Changes          | From    | To     |
+----------------------+---------+--------+
| symfony/browser-kit  | v4.4.27 | v5.4.2 |
| symfony/css-selector | v4.4.27 | v5.4.2 |
| symfony/dom-crawler  | v4.4.30 | v5.4.2 |
| symfony/filesystem   | v4.4.27 | v5.4.0 |
| symfony/finder       | v4.4.30 | v5.4.2 |
| symfony/lock         | v4.4.33 | v5.4.2 |
+----------------------+---------+--------+
longwave’s picture

We don't use symfony/translation, let's see if we can get rid of it.

+------------------------------------+---------+---------+
| Production Changes                 | From    | To      |
+------------------------------------+---------+---------+
| symfony/console                    | v4.4.34 | v5.4.2  |
| symfony/debug                      | v4.4.31 | REMOVED |
| symfony/dependency-injection       | v4.4.34 | v5.4.2  |
| symfony/error-handler              | v4.4.34 | v5.4.2  |
| symfony/event-dispatcher           | v4.4.34 | v5.4.0  |
| symfony/event-dispatcher-contracts | v1.1.11 | v3.0.0  |
| symfony/http-client-contracts      | v2.5.0  | REMOVED |
| symfony/http-foundation            | v4.4.34 | v5.4.2  |
| symfony/http-kernel                | v4.4.35 | v5.4.2  |
| symfony/mime                       | v5.4.0  | v5.4.2  |
| symfony/polyfill-ctype             | v1.23.0 | v1.24.0 |
| symfony/polyfill-iconv             | v1.23.0 | v1.24.0 |
| symfony/polyfill-intl-idn          | v1.23.0 | v1.24.0 |
| symfony/polyfill-intl-normalizer   | v1.23.0 | v1.24.0 |
| symfony/polyfill-mbstring          | v1.23.1 | v1.24.0 |
| symfony/polyfill-php80             | v1.23.1 | v1.24.0 |
| symfony/process                    | v4.4.35 | v5.4.2  |
| symfony/routing                    | v4.4.34 | v5.4.0  |
| symfony/serializer                 | v4.4.35 | v5.4.2  |
| symfony/translation                | v4.4.34 | REMOVED |
| symfony/translation-contracts      | v2.5.0  | v3.0.0  |
| symfony/validator                  | v4.4.35 | v5.4.2  |
| symfony/var-dumper                 | v5.4.0  | v5.4.2  |
| symfony/yaml                       | v4.4.34 | v5.4.2  |
| psr/event-dispatcher               | NEW     | 1.0.0   |
| symfony/polyfill-intl-grapheme     | NEW     | v1.24.0 |
| symfony/polyfill-php81             | NEW     | v1.24.0 |
| symfony/string                     | NEW     | v6.0.2  |
+------------------------------------+---------+---------+

+----------------------+---------+--------+
| Dev Changes          | From    | To     |
+----------------------+---------+--------+
| symfony/browser-kit  | v4.4.27 | v5.4.2 |
| symfony/css-selector | v4.4.27 | v5.4.2 |
| symfony/dom-crawler  | v4.4.30 | v5.4.2 |
| symfony/filesystem   | v4.4.27 | v5.4.0 |
| symfony/finder       | v4.4.30 | v5.4.2 |
| symfony/lock         | v4.4.33 | v5.4.2 |
+----------------------+---------+--------+

The last submitted patch, 55: 3197482-55.patch, failed testing. View results

Status: Needs review » Needs work

The last submitted patch, 56: 3197482-56.patch, failed testing. View results

longwave’s picture

Reopened #3231688: [Symfony 6] Add type hints to Drupal\Core\TypedData\Validation\ExecutionContext to deal with the remaining set of fails. Otherwise MimeTypePassTest needs deleting from the patch, I missed that in the reroll.

catch’s picture

longwave’s picture

Deleted MimeTypePassTest.

The last submitted patch, 56: 3197482-56.patch, failed testing. View results

catch’s picture

Status: Needs review » Reviewed & tested by the community

This looks great. It's a big patch because as well as doing the update, we also have to remove Symfony 4-5 forward compatibility layers we added in Drupal 9.

Taran2L’s picture

I've just run simple search for "symfony 4" and "symfony 5" within the codebase and I see ~15 more mentions/places where the code must be removed/amended ... setting this too NW fro now

Taran2L’s picture

Status: Reviewed & tested by the community » Needs work
longwave’s picture

Status: Needs work » Needs review

My aim here was to make the minimal set of changes to get core running on Symfony 5 with all tests passing. Did you find anything that must be done in this issue, or can we complete the SF4 cleanup in followup issues?

Taran2L’s picture

Taran2L’s picture

Taran2L’s picture

imho, we can also clean up /core/modules/system/tests/src/Functional/System/TrustedHostsTest.php#L117 here, as most of it is removed anyway.

Patch from this issue reverts parts of the #3162016-84: [Symfony 6] Retrieving a non-string value from "Symfony\Component\HttpFoundation\InputBag::get()" is deprecated and I think, we should revert what's left as well

daffie’s picture

All the code changes look good to me.
Not everything is done in this issue to remove all the Symfony 4 stuff, but we have a bunch of followups.
At least the minimum is done and Symfony is upgraded to version 5.4.
The testbot is happy.
For me it is RTBC.

The last submitted patch, 68: 3197482-68.patch, failed testing. View results

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Nice work - it's going to be so much nice step debugging deprecations without all the thousands of deprecations from mime type guessing :D

Committed 7b324dd and pushed to 10.0.x. Thanks!

  • alexpott committed 7b324dd on 10.0.x
    Issue #3197482 by longwave, Spokje, Taran2L, murilohp, catch, Gábor...
TR’s picture

Shouldn't there be a change record for this? It's a pretty big change ...

Gábor Hojtsy’s picture

Issue summary: View changes

Good point. Added https://www.drupal.org/node/3259527 and copied the same text to the release notes snippet here. Not tagging for release notes since we are not using a 10.0.0-alpha1 release notes tag apprently.

Status: Fixed » Closed (fixed)

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

jibran’s picture

+++ b/core/tests/Drupal/KernelTests/Core/TypedData/TypedDataTest.php
@@ -590,7 +590,7 @@ public function testTypedDataValidation() {
-        'Length' => ['min' => 10, 'allowEmptyString' => FALSE],
+        'Length' => ['min' => 10],

This should be converted to


        'Length' => ['min' => 10],
        'Blank' => [],

As per the docs https://github.com/symfony/symfony/blob/6.3/src/Symfony/Component/Valida...

Edit: Ignore my comment I missed that allowEmptyString was FALSE. Sorry for the noise.