Problem/Motivation

During the require through composer the package show problems to be resolved due incompatibility of with siymfony/string verison, in this case with drush 11. The latest version of siymfony/string is ^6.1, and 5 is going to be deprecated soon, also,
Reviewing the composer.json file, the module does not support php 8.1, while is becoming necessary for latest version of drupal 9.4.

Steps to reproduce

1. Have a new drupal instance using the latest version using this composer.json

{
    "name": "drupal/recommended-project",
    "description": "Project template for Drupal 9 projects with a relocated document root",
    "type": "project",
    "license": "GPL-2.0-or-later",
    "homepage": "https://www.drupal.org/project/drupal",
    "support": {
        "docs": "https://www.drupal.org/docs/user_guide/en/index.html",
        "chat": "https://www.drupal.org/node/314178"
    },
    "repositories": [
        {
            "type": "composer",
            "url": "https://packages.drupal.org/8"
        }
    ],
    "require": {
        "composer/installers": "^1.9",
        "drupal/admin_toolbar": "^3.1",
        "drupal/core-composer-scaffold": "^9.4",
        "drupal/core-project-message": "^9.4",
        "drupal/core-recommended": "^9.4",
        "drupal/paragraphs": "^1.14"
    },
    "require-dev": {
        "drush/drush": "^11.0"
    },
    "conflict": {
        "drupal/drupal": "*"
    },
    "minimum-stability": "dev",
    "prefer-stable": true,
    "config": {
        "allow-plugins": {
            "composer/installers": true,
            "drupal/core-composer-scaffold": true,
            "drupal/core-project-message": true,
            "dealerdirect/phpcodesniffer-composer-installer": true
        },
        "sort-packages": true
    },
    "extra": {
        "drupal-scaffold": {
            "locations": {
                "web-root": "web/"
            }
        },
        "installer-paths": {
            "web/core": [
                "type:drupal-core"
            ],
            "web/libraries/{$name}": [
                "type:drupal-library"
            ],
            "web/modules/contrib/{$name}": [
                "type:drupal-module"
            ],
            "web/profiles/contrib/{$name}": [
                "type:drupal-profile"
            ],
            "web/themes/contrib/{$name}": [
                "type:drupal-theme"
            ],
            "drush/Commands/contrib/{$name}": [
                "type:drupal-drush"
            ],
            "web/modules/custom/{$name}": [
                "type:drupal-custom-module"
            ],
            "web/profiles/custom/{$name}": [
                "type:drupal-custom-profile"
            ],
            "web/themes/custom/{$name}": [
                "type:drupal-custom-theme"
            ]
        },
        "drupal-core-project-message": {
            "include-keys": [
                "homepage",
                "support"
            ],
            "post-create-project-cmd-message": [
                "<bg=blue;fg=white>                                                         </>",
                "<bg=blue;fg=white>  Congratulations, you’ve installed the Drupal codebase  </>",
                "<bg=blue;fg=white>  from the drupal/recommended-project template!          </>",
                "<bg=blue;fg=white>                                                         </>",
                "",
                "<bg=yellow;fg=black>Next steps</>:",
                "  * Install the site: https://www.drupal.org/docs/8/install",
                "  * Read the user guide: https://www.drupal.org/docs/user_guide/en/index.html",
                "  * Get support: https://www.drupal.org/support",
                "  * Get involved with the Drupal community:",
                "      https://www.drupal.org/getting-involved",
                "  * Remove the plugin that prints this message:",
                "      composer remove drupal/core-project-message"
            ]
        }
    }
}

2. Run composer install
3. After install and generate composer.lock
4. Run composer require 'drupal/graphql_compose:^1.0@beta'

Got an error similar to this:

Your requirements could not be resolved to an installable set of packages.

Problem 1
- drupal/graphql_compose 1.0.0-beta1 requires drupal/node-node * -> could not be found in any version, there may be a typo in the package name.
- drupal/graphql_compose[1.0.0-beta2, ..., 1.0.0-beta21] require symfony/string ^5.4 -> found symfony/string[v5.4.0-BETA1, ..., 5.4.x-dev] but the package is fixed to v6.1.4 (lock file version) by a partial update and that version does not match. Make sure you list it as an argument for the update command.
- Root composer.json requires drupal/graphql_compose ^1.0@beta -> satisfiable by drupal/graphql_compose[1.0.0-beta1, ..., 1.0.0-beta21].

Potential causes:
- A typo in the package name
- The package is not available in a stable-enough version according to your minimum-stability setting
see for more details.
- It's a private package and you forgot to add a custom repository to find it

Proposed resolution

Add support to PHP 8.1
Add support to symfony/string v6.1.4 to make compatible with drupal 9.4.6

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

igasi created an issue. See original summary.

igasi’s picture

Issue summary: View changes
igasi’s picture

Title: Support for PHP8.1 and symfony/string > v6.1.4 for drupal 9.4.6 » Support for PHP8 and symfony/string > v6 for drupal 9.4.6
igasi’s picture

Issue summary: View changes
igasi’s picture

I opened a MR to solve this.

Steps to test:

1. Run composer install over the composer.json provided above
2. On the composer.json provided change the repositories section to

"repositories": [
        {
            "type": "composer",
            "url": "https://packages.drupal.org/8",
	    "exclude": ["drupal/graphql_compose"]
        },
        {
            "type": "git",
            "url": "https://git.drupalcode.org/issue/graphql_compose-3311055"
        }
    ],
    

3. Run composer require drupal/graphql_compose:dev-3311055-support-for-php8.1

The module should be able to resolve without issue.

  • jmolivas committed 042e0ca on 1.0.x authored by igasi
    Issue #3311055: Support for PHP8.1 and symfony/string > v6.1.4 for...
jmolivas’s picture

Status: Active » Fixed

Thanks for the MR @igasi

Status: Fixed » Closed (fixed)

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