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

karlos007 created an issue. See original summary.

kmajzlik’s picture

Next 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

kmajzlik’s picture

Title: Fatal error with fresh Drupal 8.4 » Fatal errors with fresh Drupal 8.4 (Symfony 3.x)
dbazuin’s picture

This 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

scuba_fly’s picture

In 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.

dbazuin’s picture

Version 8.x-1.0-alpha4 seems to fix this in my case.

hershey.k’s picture

Same here version 8.x-1.0-alpha4 fixed the issue for me.

kumkum29’s picture

Hello,

if I use composer to install this module I get the alpha 1 version. How to get the last version with composer ?

Thanks.

itamair’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

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