- Issue created by @dennisdk
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).
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.
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.
Review the patch attached.
Needs review
2.0
Code