Problem/Motivation

After install Drupal 8.4.0-dev and create a geofield field and try to submit the lat/lng the following error is displayed

Declaration of Drupal\\geofield\\Plugin\\Validation\\Constraint\\GeoConstraint::initialize() must be compatible with Symfony\\Component\\Validator\\ConstraintValidatorInterface::initialize(Symfony\\Component\\Validator\\Context\\ExecutionContextInterface $context) in /home/fran/Projects/community/drupal8/modules/contrib/geofield/src/Plugin/Validation/Constraint/GeoConstraint.php on line 22

It seems ExecutionContextInterface is deprecated and we have to use Context\ExecutionContextInterface as is indicated in Drupal API

Proposed resolution

To fix the problem we should change geofield/src/Plugin/Validation/Constraint/GeoConstraint.php file adding the correct path to the interface.

use Symfony\Component\Validator\Context\ExecutionContextInterface;

Remaining tasks

  • Create patch

Comments

fran seva created an issue. See original summary.

fran seva’s picture

Assigned: fran seva » Unassigned
Status: Active » Needs review
StatusFileSize
new975 bytes

I have attached a patch adding the paths to Context/ExecutionContextInterface.

  • plopesc committed c2fee9d on 8.x-1.x authored by fran seva
    Issue #2879401 by fran seva: Deprecated ExecutionContextInterface used...
plopesc’s picture

Status: Needs review » Fixed

Fixed! Thanks

Status: Fixed » Closed (fixed)

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