Problem/Motivation

Since symfony/console 7.4: The "Symfony\Component\Console\Application::add()" method is deprecated and will be removed in Symfony 8.0, use "Symfony\Component\Console\Application::addCommand()" instead.

Steps to reproduce

Proposed resolution

Change references to the deprecated method.

Remaining tasks

User interface changes

Introduced terminology

API changes

Data model changes

Release notes snippet

Issue fork drupal-3555528

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.

aryan singh’s picture

Working..

aryan singh’s picture

The pipeline fails because the Drupal 11.x core still uses "symfony/console": "^7.3", where addCommand() method does not yet exist.

longwave’s picture

Status: Active » Postponed

Thanks for working on this - looks like this has to wait until #3554533: Update to Symfony 7.4.0-BETA2 is committed.

longwave’s picture

Status: Postponed » Needs review

The related issue landed so this should be doable now.

smustgrave’s picture

Status: Needs review » Reviewed & tested by the community

Was hard to do a search for ->add( but did some spot checking and all instances calling Symfony console add I believe have been replaced.

catch’s picture

Status: Reviewed & tested by the community » Needs work

Needs a rebase.

quietone made their first commit to this issue’s fork.

quietone’s picture

Status: Needs work » Reviewed & tested by the community

Rebase with a simple conflict in .deprecation-ignore.txt. Tests are passing so setting back to RTBC.

xjm’s picture

Title: Since symfony/console 7.4: The "Symfony\Component\Console\Application::add()" method is deprecated » \Symfony\Component\Console\Application::add() is deprecated in Symfony 7.4
xjm’s picture

Title: \Symfony\Component\Console\Application::add() is deprecated in Symfony 7.4 » Symfony\Component\Console\Application::add() is deprecated in Symfony 7.4
xjm’s picture

Issue tags: -Novice
catch’s picture

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

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.

  • catch committed 94a884fb on 11.3.x
    fix: #3555528 Symfony\Component\Console\Application::add() is deprecated...

  • catch committed 4e7cd760 on 11.x
    fix: #3555528 Symfony\Component\Console\Application::add() is deprecated...

Status: Fixed » Closed (fixed)

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

maheshv’s picture

I ran the frontend command after upgrading Drupal to version 11.3.5, but I am still encountering this issue.

ERROR: Since symfony/console 7.4: The "Symfony\Component\Console\Application::add()" method is deprecated and will be removed in Symfony 8.0, use "Symfony\Component\Console\Application::addCommand()" instead.
in /app/vendor/symfony/deprecation-contracts/function.php:25

maheshv’s picture

Is this code available in Drupal 11.3.5? I didn't see it in the release notes.

cilefen’s picture

@maheshv, Drupal Core corrected this deprecation. I have been suggesting in #3583418: ERROR: Since symfony/console 7.4: The Symfony\Component\Console\Application::add() is deprecated in Symfony 7.4 that what you see originates from Lando code.