d8-contrib-modules / password_policy

DEPRECATED - released to drupal.org
https://www.drupal.org/project/password_policy
0 stars 10 forks source link

Fixes bugs in PasswordReset behavior #51

Closed pbull closed 9 years ago

pbull commented 9 years ago

When resetting passwords by role, the following bugs were encountered:

This PR addresses the above issues - the only logic changes are in submitForm(). Note that UserStorage::loadByProperties(['roles' => [...]]) can take an array of multiple roles and then uses an "IN" condition in the query, so a user assigned to many roles is still only loaded once.

Also some general syntax and doc cleanup issues identified by phpcs (below).

FILE: ...s/drupal8-git/modules/password_policy/src/Form/PasswordReset.php
----------------------------------------------------------------------
FOUND 14 ERRORS AFFECTING 10 LINES
----------------------------------------------------------------------
  1 | ERROR | [x] Missing file doc comment
 14 | ERROR | [x] Missing class doc comment
 16 | ERROR | [ ] Missing short description in doc comment
 19 | ERROR | [ ] Class property $role_storage should use lowerCamel
    |       |     naming without underscores
 21 | ERROR | [ ] Missing short description in doc comment
 24 | ERROR | [ ] Class property $user_storage should use lowerCamel
    |       |     naming without underscores
 26 | ERROR | [x] Missing function doc comment
 27 | ERROR | [ ] Inline doc block comments are not allowed; use "/*
    |       |     Comment */" or "// Comment" instead
 32 | ERROR | [x] Missing function doc comment
 32 | ERROR | [ ] Visibility must be declared on method "__construct"
 90 | ERROR | [x] Expected 1 space before "=="; 0 found
 90 | ERROR | [x] Expected 1 space after "=="; 0 found
 90 | ERROR | [x] Expected 1 space before "=="; 0 found
 90 | ERROR | [x] Expected 1 space after "=="; 0 found
nerdstein commented 9 years ago

Awesome, thanks and nice catch