Problem/Motivation

Analysing the codebase with phpstan, I'm getting:

Fatal error: Declaration of Drupal\redirect\Plugin\Validation\Constraint\SourceLinkTypeConstraint::initialize(Symfony\Component\Validator\ExecutionContextInterface $context) must be compatible with Symfony\Component\Validator\ConstraintValidatorInterface::initialize(Symfony\Component\Validator\Context\ExecutionContextInterface $context) in /Users/clau/development/joinup-dev/web/modules/contrib/redirect/src/Plugin/Validation/Constraint/SourceLinkTypeConstraint.php on line 23

The Symfony interface namespace has changed. This was also discovered in #3001234: Redirect entity validation is never called.

Proposed resolution

Fix it.

Remaining tasks

None.

User interface changes

None.

API changes

None.

Data model changes

None.

Release notes snippet

N/A

CommentFileSizeAuthor
#2 3048310-2.patch1.13 KBclaudiu.cristea

Comments

claudiu.cristea created an issue. See original summary.

claudiu.cristea’s picture

Status: Active » Needs review
StatusFileSize
new1.13 KB

Patch.

berdir’s picture

i don't think we need another issue for this, the question in the other issue remains.. either we need this constraint, then we need to acutally use it or alternatively, we can remove it completely.

claudiu.cristea’s picture

@Berdir, it seems that is not used as this error hasn't surfaced. I just needed a quick solution for my code analysis.

berdir’s picture

Yes, right now it isn't and the other issue was changing that. But I or someone else need to figure out/document what exactly it was doing and then decide on the option. Also, tests :) I suspect the existing patch there would work too for you as it includes that fix, but I'm not 100% sure about any side effects that actually using that constraint could have.

Berdir credited mglaman.

berdir’s picture

Status: Needs review » Fixed

Got a duplicate of this in the meantime, fair enough, committed and we can figure out in the referenced issue if it's needed or not.

Status: Fixed » Closed (fixed)

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