Problem/Motivation

https://symfony.com/blog/symfony-7-4-0-beta1-released

Previously tried to include this in #3552765: Update Composer dependencies for 11.3.0 but there are some new deprecations so seems worth spinning this out to its own issue.

Steps to reproduce

Proposed resolution

Remaining tasks

Symfony regressions found

User interface changes

Introduced terminology

API changes

Data model changes

Release notes snippet

Issue fork drupal-3554533

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

longwave created an issue. See original summary.

longwave’s picture

This is where we run into #3522497: Passing an $options array to constraint constructors is deprecated, use named arguments instead, plus we can't call $request->get() directly any more, we have to specifically know whether we want POST (request) or GET (query) data; but in Drupal we sometimes use both interchangeable...

longwave’s picture

Status: Active » Needs work

Finding it impossible to debug most of the remaining failures due to way too many deprecations via #3522497: Passing an $options array to constraint constructors is deprecated, use named arguments instead

longwave’s picture

Trying an upgrade of everything except symfony/validator, which hopefully we can deal with in a followup given there are many new deprecations.

longwave’s picture

longwave’s picture

There are a bunch of functional test failures that I can't reproduce locally, and some Ajax JavaScript failures that I haven't had chance to investigate yet.

longwave’s picture

Title: Update to Symfony 7.4.0-BETA1 » Update to Symfony 7.4.0-BETA1 (except symfony/validator)
longwave’s picture

Some fun here in that DomCrawler now behaves differently on PHP 8.3 and 8.4 - on 8.4, Symfony now uses the native HTML5 parser instead of masterminds/html5 - so we need to make sure we run tests on both.

See https://github.com/symfony/symfony/commit/bd7fb5178b998e4f863d388850e93b...

I think this is the cause of some/most of the remaining test failures.

longwave’s picture

I think this is a second regression in Symfony: https://github.com/symfony/symfony/issues/62233

longwave’s picture

The second regression is fixed in Symfony 7.4.x-dev, but I found a third: https://github.com/symfony/symfony/issues/62236

andypost’s picture

longwave changed the visibility of the branch 3554533-symfony-7.4 to hidden.

longwave’s picture

Trying to make the MR as minimal as possible, we will have to deal with new deprecations in followups (but ideally the big ones need to be removed before 11.3.0 so contrib gets notified of them)

Currently has the following changes:

  • Symfony 7.4.0-BETA1 (except symfony/validator, which has even more deprecations)
  • Four new deprecation skips, which will each need a followup to solve
  • Change of the DomCrawler used by BrowserTestBase to use the non-HTML5 parser in PHP 8.4 (there are some incompatibilities that I have opened Symfony issues for)
  • Change of the default Content-Type header charset from "UTF-8" to "utf-8" (affects many tests)
quietone’s picture

Issue summary: View changes

just putting links to the Symfony issues in the issue summary.

longwave’s picture

First green run. Let's try adding back symfony/validator...

longwave’s picture

Title: Update to Symfony 7.4.0-BETA1 (except symfony/validator) » Update to Symfony 7.4.0-BETA1
Status: Needs work » Needs review

This is now the minimal amount of changes required to land 7.4.0-BETA1, all deprecation skips or other temporary fixes (such as the "UTF-8" to "utf-8" change) have been moved to child issues of #3555526: Update to Symfony 7.4.0.

godotislate’s picture

MR is pretty straightforward and overall looks good.

I had a couple questions about whether followups need to be created for a deprecation and PHPStan issue.
Also, it looks like two of the Symfony regressions have been addressed, but the third about the ampersand is an inconsistency in the HTML spec and won't be addressed by Symfony. Is there any adjustment to Drupal tests needed?

longwave’s picture

We will have to figure out how to solve the ampersand issue over in #3555527: Since symfony/dom-crawler 7.4: Disabling HTML5 parsing is deprecated. Symfony 8 will unconditionally use the native HTML5 parser. The code generates some very questionable HTML for the sake of an XSS-like test but I'm not sure how valid it really is. https://github.com/symfony/symfony/pull/62252 has comments from both a Symfony maintainer and the author of the PHP HTML5 extension commenting that my solution was a bad idea, so I will go along with what they say!

godotislate’s picture

Status: Needs review » Reviewed & tested by the community

All questions addressed, lgtm.

longwave’s picture

Title: Update to Symfony 7.4.0-BETA1 » Update to Symfony 7.4.0-BETA2

Bumped to BETA2: https://symfony.com/blog/symfony-7-4-0-beta2-released

This means we can remove a workaround for a bug in beta1 that was fixed in beta2: https://github.com/symfony/symfony/issues/62226

andypost’s picture

I bet it needs CR and update CR https://www.drupal.org/node/2150267 which is wrongly points to $request->get() but should tell to use one of properties

Call to deprecated method get\\(\\) of class Symfony\\\\Component\\\\HttpFoundation\\\\Request\\:
since Symfony 7\\.4, use properties `\\-\\>attributes`, `query` or `request` directly instead

longwave’s picture

@andypost Followups for the deprecations all exist as children of #3555526: Update to Symfony 7.4.0

Not sure we need a change record, we haven't made any API changes - this is just a release notes thing really. We might need change records for some of the deprecations but that will happen in the followups.

catch’s picture

One question on the MR, leaving RTBC.

quietone’s picture

Issue tags: +11.3.0 release notes

  • catch committed 0f378d5d on 11.3.x
    Issue #3554533 by longwave, andypost, quietone, godotislate: Update to...

  • catch committed 48a58c35 on 11.x
    Issue #3554533 by longwave, andypost, quietone, godotislate: Update to...
catch’s picture

Version: 11.x-dev » 11.3.x-dev
Status: Reviewed & tested by the community » Fixed

Asked for a comment on the test change, but @longwave pointed out that while it's the odd one out now, it won't be when we remove the bc layer, so no comment is needed indeed.

Committed/pushed to 11.x and cherry-picked to 11.3.x, thanks!

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

quietone’s picture

Issue tags: +needs release note snippet

It would help if this had a snippet.

Status: Fixed » Closed (fixed)

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

quietone’s picture

Issue tags: -needs release note snippet

Removing tag no longer needed.