diff --git a/docroot/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/PasswordItem.php b/docroot/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/PasswordItem.php index 7caa26f..96ed2b4 100644 --- a/docroot/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/PasswordItem.php +++ b/docroot/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/PasswordItem.php @@ -46,7 +46,7 @@ public function preSave() { $entity = $this->getEntity(); // Update the user password if it has changed. - if ($entity->isNew() || (strlen(trim($this->value)) > 0 && $this->value != $entity->original->{$this->getFieldDefinition()->getName()}->value)) { + if (!$entity->is_hashed && ($entity->isNew() || (strlen(trim($this->value)) > 0 && $this->value != $entity->original->{$this->getFieldDefinition()->getName()}->value))) { // Allow alternate password hashing schemes. $this->value = \Drupal::service('password')->hash(trim($this->value)); // Abort if the hashing failed and returned FALSE. diff --git a/docroot/core/modules/user/src/Plugin/migrate/destination/EntityUser.php b/docroot/core/modules/user/src/Plugin/migrate/destination/EntityUser.php index beda7c8..64e8232 100644 --- a/docroot/core/modules/user/src/Plugin/migrate/destination/EntityUser.php +++ b/docroot/core/modules/user/src/Plugin/migrate/destination/EntityUser.php @@ -132,4 +132,13 @@ protected function processStubRow(Row $row) { } } + /** + * {@inheritdoc} + */ + protected function save(ContentEntityInterface $entity, array $old_destination_id_values = array()) { + $entity->is_hashed = TRUE; + + return parent::save($entity, $old_destination_id_values); + } + }