Problem/Motivation
As of Drupal 11 the UserLoginBlock constructor requires the $formBuilder argument, see https://www.drupal.org/node/3159776 . Previously the parent class constructor allowed a nullable $formBuilder argument. This was however deprecated in drupal 10.3.0 and now required in drupal 11. The following error will be thrown during updatedb process when upgrading to any version of drupal 11.
[error] ArgumentCountError: Too few arguments to function Drupal\user\Plugin\Block\UserLoginBlock::__construct(), 4 passed in /app/web/modules/contrib/email_tfa/src/Plugin/Block/EmailTfaUserLoginBlock.php on line 52 and exactly 5 expected in Drupal\user\Plugin\Block\UserLoginBlock->__construct() (line 57 of /app/web/core/modules/user/src/Plugin/Block/UserLoginBlock.php)
Steps to reproduce
1. Be on module version ^2.0.
2. Upgrade site to Drupal 11
3. Run drush updatedb -> this will trigger the error.
Proposed resolution
Created a patch file and attached. Seems to resolve the issue and allow for drush updatedb to complete.
Remaining tasks
User interface changes
API changes
Data model changes
| Comment | File | Size | Author |
|---|---|---|---|
| fix-login-block-constructor.patch | 1.82 KB | mclewley |
Comments
Comment #2
avpaderno