Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Fatal error: Declaration of Drupal\geofield\Plugin\Validation\Constraint\GeoConstraint::initialize(Symfony\Component\Validator\ExecutionContextInterface $context) must be compatible with Symfony\Component\Validator\ConstraintValidatorInterface::initialize(Symfony\Component\Validator\Context\ExecutionContextInterface $context) in /var/www/html/docroot/modules/contrib/geofield/src/Plugin/Validation/Constraint/GeoConstraint.php on line 23
Patch will be easy, i will post it later, it is only about change in "use" statement in that plugin.
Comments
Comment #2
kmajzlik CreditAttribution: kmajzlik at Ciklum Western Europe for BurdaForward commentedNext one:
Fatal error: Declaration of Drupal\geofield\Plugin\Field\FieldFormatter\GeofieldDefaultFormatter::viewElements(Drupal\Core\Field\FieldItemListInterface $items) must be compatible with Drupal\Core\Field\FormatterInterface::viewElements(Drupal\Core\Field\FieldItemListInterface $items, $langcode) in /var/www/html/docroot/modules/contrib/geofield/src/Plugin/Field/FieldFormatter/GeofieldDefaultFormatter.php on line 84
Comment #3
kmajzlik CreditAttribution: kmajzlik at Ciklum Western Europe for BurdaForward commentedComment #4
dbazuin CreditAttribution: dbazuin commentedThis one in line 22:
Fatal error: Declaration of Drupal\geofield\Plugin\Validation\Constraint\GeoConstraint::initialize(Symfony\Component\Validator\ExecutionContextInterface $context) must be compatible with Symfony\Component\Validator\ConstraintValidatorInterface::initialize(Symfony\Component\Validator\Context\ExecutionContextInterface $context) in /var/www/sf/htdocs/modules/contrib/geofield/src/Plugin/Validation/Constraint/GeoConstraint.php on line 22
Comment #5
scuba_flyIn the symfony/validator/CHANGELOG.md I see a Backwards compatibility BREAK:
* [BC BREAK] `ConstraintValidatorInterface::initialize` is now type hinted against `ExecutionContextInterface` instead of `ExecutionContext`
I think the solution is to just replace the type hint class with it's interface. It makes sense to type hint on the interface instead of a class.
This way the class will be swappable with another class that implements the same interface.
Comment #6
dbazuin CreditAttribution: dbazuin commentedVersion 8.x-1.0-alpha4 seems to fix this in my case.
Comment #7
hershey.k CreditAttribution: hershey.k commentedSame here version 8.x-1.0-alpha4 fixed the issue for me.
Comment #8
kumkum29 CreditAttribution: kumkum29 commentedHello,
if I use composer to install this module I get the alpha 1 version. How to get the last version with composer ?
Thanks.
Comment #9
itamair CreditAttribution: itamair commented