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
- Clone the code source and checkout to the branch : 10.0.x
- Run command : composer install (optionnal)
- Run command : composer update
- Go to installation interface, Langue : English, Profil : Standard, Database : MariaDB
- Validate "Configure site" form
- 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 ?
| Comment | File | Size | Author |
|---|---|---|---|
| #10 | methods_not_compatible_with_symfony_interface.patch | 1.94 KB | netsliver |
| methods_not_compatible_with_symfony_interface.patch | 1.92 KB | rmpereira |
Comments
Comment #2
rmpereira commentedComment #3
cilefen commentedDid you install Drupal according to the instructions, which include drupal/core-recommended?
Comment #4
rmpereira commentedI 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)
Comment #5
cilefen commentedThat is correct. You must use drupal/core-recommended or manage the dependency ranges manually.
Comment #6
rmpereira commentedOk, thank you. I'll adjust the dependencies of my composer project.
Comment #7
cilefen commentedComment #8
cilefen commentedComment #9
chi commented@cilefen, I think it's wrong. As the package name suggests
drupal/core-recommendedis recommended not required. And dependency ranges are managed manually only for packages that you are maintaining yourself. For third party packages likedrupal/coreall dependency should be set automatically by composer.Comment #10
netsliverattached patch with core path
Comment #11
gordon commentedI 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.