I encountered an error reported in an another module that adds a submit handler to the login form:
Warning: trim() expects parameter 1 to be string, array given in Drupal\ldap_authentication\Controller\LoginValidator->validateLogin() (line 81 of modules/contrib/ldap/ldap_authentication/src/Controller/LoginValidator.php).

Upon investigation I found that the submit handler super_login_user_login_validate() was the first in the stack, and that if an email was used and thus kicking off the code in this function that the username was replaced in the 'name' field as expected, but as an array, which is not (at least in our case).

The attached patch removes the array casting, keeping the name value a string as at least the other modules in our system expects, removing the error.

Comments

ironsizide created an issue. See original summary.

ironsizide’s picture

StatusFileSize
new5.92 KB

3cwebdev’s picture

Thank you. Patch has been committed to DEV for further testing.

3cwebdev’s picture

Status: Active » Needs review
neclimdul’s picture

Status: Needs review » Fixed

fixed?

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.