Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save nelson-ph/ccf580d8ad2c54bcf5020f5c01cb61b9 to your computer and use it in GitHub Desktop.

Select an option

Save nelson-ph/ccf580d8ad2c54bcf5020f5c01cb61b9 to your computer and use it in GitHub Desktop.
Drupal - Password policy - review patch to add error message to the storage
Index: password_policy.module
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/password_policy.module b/password_policy.module
--- a/password_policy.module
+++ b/password_policy.module (date 1638189983327)
@@ -197,10 +197,12 @@
$user,
$roles
);
+ $form_state->set('password_fails_policies_message', null);
if ($validationReport->isInvalid()) {
$form_state->setErrorByName('pass', t('The password does not satisfy the password policies.'));
$form_state->setError($form, $validationReport->getErrors());
+ $form_state->set('password_fails_policies_message', $validationReport->getErrors());
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment