(Fatal) TypeError in CustomUserLoginForm

Created on 16 May 2024, 6 months ago

Problem/Motivation

When using the ajax_login_popup module with AJAX, I encountered a TypeError. The detailed error message is as follows:
TypeError: Drupal\Core\Form\FormBase::t(): Argument #2 ($args) must be of type array, string given, called in /var/www/html/web/modules/contrib/ajax_login_popup/src/Form/CustomUserLoginForm.php on line 289 in Drupal\Core\Form\FormBase->t() (line 70 of /var/www/html/web/core/lib/Drupal/Core/StringTranslation/StringTranslationTrait.php).

Steps to reproduce

Install the ajax_login_popup module.
Navigate to the login page that uses the AJAX login popup functionality.
Attempt to log in using the form provided, make sure the flood error is triggered.
Observe the error message in the browser console and the AJAX response.

Proposed resolution

Review the CustomUserLoginForm class, specifically the line where FormBase::t() is called with incorrect arguments. Modify the code to ensure that the second argument passed to the t() method is an array.

Remaining tasks

Review the patch attached.

🐛 Bug report
Status

Needs review

Version

2.0

Component

Code

Created by

🇳🇱Netherlands dennisdk

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024