- Issue created by @d4t3r
- Status changed to Closed: duplicate
about 2 months ago 11:09am 22 July 2024 - 🇩🇪Germany d4t3r
This seems to be a problem from mail login: See 🐛 Error with new version of module "mail_login" v4.0.0 for Drupal ^10.3 || ^11 RTBC
- Status changed to Active
about 2 months ago 3:27pm 22 July 2024 - 🇩🇪Germany d4t3r
Re-opening. The patch from the related issue #3462452 seems to be the wrong way. And the wrong place. I am not sure, but I read in the error message "UserAuthInterface" instead of "UserAuthenticationInterface". Sounds wrong, deprecated.
- 🇸🇮Slovenia LUTi
I've managed to run Security Review with the following patch:
diff -up modules/contrib/security_review/src/Plugin/SecurityCheck/NamePasswords.php~ modules/contrib/security_review/src/Plugin/SecurityCheck/NamePasswords.php --- modules/contrib/security_review/src/Plugin/SecurityCheck/NamePasswords.php~ 2024-07-10 19:55:58.848825234 +0200 +++ modules/contrib/security_review/src/Plugin/SecurityCheck/NamePasswords.php 2024-07-23 21:24:40.015774057 +0200 @@ -14,7 +14,7 @@ use Drupal\Core\Plugin\ContainerFactoryP use Drupal\security_review\CheckResult; use Drupal\security_review\SecurityCheckBase; use Drupal\user\Entity\User; -use Drupal\user\UserAuthInterface; +use Drupal\user\UserAuthenticationInterface; use Symfony\Component\DependencyInjection\ContainerInterface; /** @@ -53,9 +53,9 @@ class NamePasswords extends SecurityChec /** * Drupal's user authentication service. * - * @var \Drupal\user\UserAuthInterface + * @var \Drupal\user\UserAuthenticationInterface */ - protected UserAuthInterface $userAuth; + protected UserAuthenticationInterface $userAuth; /** * {@inheritdoc} @@ -97,7 +97,7 @@ class NamePasswords extends SecurityChec $users = User::loadMultiple($ids); $findings = []; foreach ($users as $user) { - if ($this->userAuth->authenticate($user->getDisplayName(), $user->getDisplayName())) { + if ($this->userAuth->authenticateAccount($this->userAuth->lookupAccount($user->getDisplayName()), $user->getDisplayName())) { $findings[] = $user->getDisplayName(); }
- 🇩🇪Germany d4t3r
Due to the fact, that disabling Security Review shows the same error, i tried the patch. I copied it into a file and configured composer-patches to apply it.
But the patch is faulty, e.g.@@ -14,7 +14,7 @@ use Drupal\Core\Plugin\ContainerFactoryP
And there is a file not found, too. With my poor knowlegde I can't say if it is the non existend tilde fileNamePasswords.php~
or a double path componentmodules/contrib/security_review/
or both. - 🇫🇷France erwangel
I came to the same error while uninstalling the deprecated module (in D10.3.1) layout_builder_expose_all_field_blocks with drush pm:uninstall.
TypeError: Cannot assign Drupal\mail_login\AuthDecorator to property Drupal\security_review\Plugin\SecurityCheck\NamePasswords::$userAuth of type Drupal\user\UserAuthInterface in Drupal\security_review\Plugin\SecurityCheck\NamePasswords::create() (line 67 of /path_to_site/web/modules/contrib/security_review/src/Plugin/SecurityCheck/NamePasswords.php) #0 /path_to_site/web/core/lib/Drupal/Core/Plugin/Factory/ContainerFactory.php(21): Drupal\security_review\Plugin\SecurityCheck\NamePasswords::create()
Then while accessing admin/config/security-review: WSOD with the following
TypeError: Cannot assign Drupal\mail_login\AuthDecorator to property Drupal\security_review\Plugin\SecurityCheck\NamePasswords::$userAuth of type Drupal\user\UserAuthInterface in Drupal\security_review\Plugin\SecurityCheck\NamePasswords::create() (line 67 of modules/contrib/security_review/src/Plugin/SecurityCheck/NamePasswords.php).
No problem to access admin/config/people/mail-login
- Status changed to Needs work
27 days ago 7:44am 23 August 2024 - 🇩🇪Germany d4t3r
Mail Login 4.0.3 solved my main issue. I keep this issue open, because the deprecated code seems not to be targeted anywhere else.