Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
In Drupal 7, this piece of code is used to disable the user.module password javascript:
/**
* Implements hook_element_info_alter().
*/
function password_strength_element_info_alter(&$types) {
// Remove user_form_process_password_confirm process callback from
// password_confirm element. This will remove the password strength
// checker on password fields.
if (isset($types['password_confirm']['#process'])) {
$process = 'user_form_process_password_confirm';
if (($position = array_search($process, $types['password_confirm']['#process'])) !== FALSE) {
unset($types['password_confirm']['#process'][$position]);
}
}
}
However Drupal 6 doesn't offer hook_element_info_alter() or similar. The js is added by _user_password_dynamic_validation() which is called in user_edit_form().
Proposed resolution
Remaining tasks
User interface changes
API changes
Comment | File | Size | Author |
---|---|---|---|
#3 | 2297463_3_user_js_css.patch | 389 bytes | scor |
Comments
Comment #1
scor CreditAttribution: scor commentedComment #2
scor CreditAttribution: scor commentedLooks like we have 2 solutions:
- hide the span.password-strength in CSS. This class is only used in core and not in the password strength module (we use longer, more specific class names)
- hide the span.password-strength JS... except that
$('.password-strength').hide();
doesn't seem to cut it, maybe because user.js manipulates it after typing the password.Comment #3
scor CreditAttribution: scor commentedComment #4
coltrane(moving to Password Strength project)
Comment #6
scor CreditAttribution: scor commentedI've committed this patch. I would love it if someone would know a better way of achieving goal.