Declaration of BankIDProtectedUserFieldConstraintValidator::validate() not compatible

Created on 12 September 2025, 29 days ago

Problem/Motivation

When upgrading from Drupal 10.x to 11.2.x the following PHP fatal error occurs:

PHP Fatal error: Declaration of Drupal\bankid\Plugin\Validation\Constraint\BankIDProtectedUserFieldConstraintValidator::validate($items, Symfony\Component\Validator\Constraint $constraint) must be compatible with Drupal\user\Plugin\Validation\Constraint\ProtectedUserFieldConstraintValidator::validate($items, Symfony\Component\Validator\Constraint $constraint): void in /var/www/html/web/modules/contrib/bankid/src/Plugin/Validation/Constraint/BankIDProtectedUserFieldConstraintValidator.php on line 47

Steps to reproduce

Upgrade a site having BankID module installed from 10.x to 11.2.x.

Proposed resolution

Add the missing void return type to BankIDProtectedUserFieldConstraintValidator::validate().

Remaining tasks

Alter the code.

User interface changes

None.

API changes

None.

Data model changes

None.

🐛 Bug report
Status

Active

Version

1.0

Component

Code

Created by

🇸🇪Sweden peter törnstrand

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024