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

CommentFileSizeAuthor
fix-login-block-constructor.patch1.82 KBmclewley

Comments

mclewley created an issue. See original summary.

avpaderno’s picture

Version: 2.0.5 » 2.0.x-dev
Status: Patch (to be ported) » Closed (duplicate)
Related issues: +#3553925: Fix EmailTfaUserLoginBlock constructor for Drupal 11 compatibility (UserLoginBlock change)

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.