Problem/Motivation

At the installation of Drupal, after the step "Configure site", i get the error :

Fatal error: Declaration of Drupal\Core\TypedData\Validation\ExecutionContext::setNode($value, $object, ?Symfony\Component\Validator\Mapping\MetadataInterface $metadata, $propertyPath) must be compatible with Symfony\Component\Validator\Context\ExecutionContextInterface::setNode(mixed $value, ?object $object, ?Symfony\Component\Validator\Mapping\MetadataInterface $metadata, string $propertyPath): void in /var/www/html/drupal-core/core/lib/Drupal/Core/TypedData/Validation/ExecutionContext.php on line 136

Before to start the installation i've run the commande composer install (no problem) but if i run the command composer update, many symfony components are updated to 6.3 version.

My environnement :
PHP 8.2
Drupal 10.0.10-dev

Steps to reproduce

  1. Clone the code source and checkout to the branch : 10.0.x
  2. Run command : composer install (optionnal)
  3. Run command : composer update
  4. Go to installation interface, Langue : English, Profil : Standard, Database : MariaDB
  5. Validate "Configure site" form
  6. Fatal Error

Proposed resolution

Add return type to the methods of Drupal class ExecutionContext : see patch
May be lock the dependencies version of Symfony componants to < 6.3.0 ?

Comments

rmpereira created an issue. See original summary.

rmpereira’s picture

Title: ExecutionContext::setNode() method not compatible with symfony/validator interaface » ExecutionContext::setNode() method not compatible with symfony/validator interface
cilefen’s picture

Component: typed data system » other
Status: Active » Postponed (maintainer needs more info)

Did you install Drupal according to the instructions, which include drupal/core-recommended?

rmpereira’s picture

Component: other » typed data system
Status: Postponed (maintainer needs more info) » Active

I don't use drupal/core-recommended package in my composer, i use directly drupal/core.

I deduce in this case we need to include the dependency manually for symfony packages ? (or use drupal/core-recommended)

cilefen’s picture

Category: Bug report » Support request

That is correct. You must use drupal/core-recommended or manage the dependency ranges manually.

rmpereira’s picture

Ok, thank you. I'll adjust the dependencies of my composer project.

cilefen’s picture

Status: Active » Closed (works as designed)
cilefen’s picture

chi’s picture

You must use drupal/core-recommended or manage the dependency ranges manually

@cilefen, I think it's wrong. As the package name suggests drupal/core-recommended is recommended not required. And dependency ranges are managed manually only for packages that you are maintaining yourself. For third party packages like drupal/core all dependency should be set automatically by composer.

netsliver’s picture

attached patch with core path

gordon’s picture

I have investigated this further as I couldn't apply this patch to 10.1. The resolution says "Closed (works as designed)" however this patch was added to 10.1.x but not via this issue. This may have not been as issue at all and was just updated as part of updates to Symfony.