diff --git a/core/modules/user/src/AccountForm.php b/core/modules/user/src/AccountForm.php index ec0301f..850e55d 100644 --- a/core/modules/user/src/AccountForm.php +++ b/core/modules/user/src/AccountForm.php @@ -390,8 +390,6 @@ public function validate(array $form, FormStateInterface $form_state) { // Customly trigger validation of manually added fields and add in // violations. This is necessary as entity form displays only invoke entity // validation for fields contained in the display. - - $field_names = array( 'name', 'mail', diff --git a/core/modules/user/src/Plugin/Validation/Constraint/UserPasswordLengthValidator.php b/core/modules/user/src/Plugin/Validation/Constraint/UserPasswordLengthValidator.php index 08170a3..07251e5 100644 --- a/core/modules/user/src/Plugin/Validation/Constraint/UserPasswordLengthValidator.php +++ b/core/modules/user/src/Plugin/Validation/Constraint/UserPasswordLengthValidator.php @@ -43,21 +43,20 @@ public function validate($items, Constraint $constraint) { if (!$items) { // If no entity is present, we cannot validate. // @todo Remove once we can access the raw password on user-edits when - // https://www.drupal.org/node/2418119 is resolved. + // https://www.drupal.org/node/2418119 is resolved. return; } + /* @var \Drupal\Core\Field\FieldItemListInterface $items */ $password = $items->value; $entity = $items->getEntity(); // @todo Revisit user edit password validation when blocker - // https://www.drupal.org/node/2418119 is resolved. - if ($entity->isNew()) { - $password_length = Unicode::strlen($password); - $minimum_password_length = $this->config->get('minimum_password_length'); + // https://www.drupal.org/node/2418119 is resolved. + $password_length = Unicode::strlen($password); + $minimum_password_length = $this->config->get('minimum_password_length'); - if ($password_length < $minimum_password_length) { - $this->context->addViolation($constraint->message, array('@minimum_password_length' => $minimum_password_length)); - } + if ($password_length < $minimum_password_length) { + $this->context->addViolation($constraint->message, array('@minimum_password_length' => $minimum_password_length)); } }