diff --git a/core/modules/migrate/migrate.services.yml b/core/modules/migrate/migrate.services.yml index 3f2d32d..d8ecc7f 100644 --- a/core/modules/migrate/migrate.services.yml +++ b/core/modules/migrate/migrate.services.yml @@ -20,3 +20,4 @@ services: password_migrate: class: Drupal\migrate\MigratePassword arguments: ['@password_original'] + lazy: true diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateUserTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateUserTest.php index 0e781ce..d7ebec0 100644 --- a/core/modules/migrate_drupal/src/Tests/d6/MigrateUserTest.php +++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateUserTest.php @@ -156,6 +156,7 @@ public function testUser() { $roles[] = reset($role); } + /** @var \Drupal\user\UserInterface $user */ $user = User::load($source->uid); $this->assertIdentical($source->uid, $user->id()); $this->assertIdentical($source->name, $user->label()); @@ -183,7 +184,7 @@ public function testUser() { // Use the API to check if the password has been salted and re-hashed to // conform the Drupal >= 7. - $this->assertTrue(\Drupal::service('password')->check($source->pass_plain, $user)); + $this->assertTrue(\Drupal::service('password')->check($source->pass_plain, $user->getPassword())); } } diff --git a/core/modules/user/src/Entity/User.php b/core/modules/user/src/Entity/User.php index 05b642a..53155a0 100644 --- a/core/modules/user/src/Entity/User.php +++ b/core/modules/user/src/Entity/User.php @@ -393,7 +393,7 @@ public function setExistingPassword($password) { * {@inheritdoc} */ public function checkExistingPassword(UserInterface $account_unchanged) { - return !empty($this->get('pass')->existing) && \Drupal::service('password')->check(trim($this->get('pass')->existing), $account_unchanged); + return !empty($this->get('pass')->existing) && \Drupal::service('password')->check(trim($this->get('pass')->existing), $account_unchanged->getPassword()); } /**