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
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | 3048310-2.patch | 1.13 KB | claudiu.cristea |
Comments
Comment #2
claudiu.cristeaPatch.
Comment #3
berdiri 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.
Comment #4
claudiu.cristea@Berdir, it seems that is not used as this error hasn't surfaced. I just needed a quick solution for my code analysis.
Comment #5
berdirYes, 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.
Comment #7
berdirGot 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.