Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix typos in user creation with initial password #1030

Merged
merged 1 commit into from
Sep 5, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/sprinkles/admin/schema/requests/user/create.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ passwordc:
message: VALIDATE.REQUIRED
matches:
domain: client
field: value
field: password
label: "&PASSWORD.CONFIRM"
message: VALIDATE.PASSWORD_MISMATCH
length:
Expand Down
6 changes: 3 additions & 3 deletions app/sprinkles/admin/src/Controller/UserController.php
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ public function create(Request $request, Response $response, $args)
$passwordRequest = $this->ci->repoPasswordReset->create($user, $config['password_reset.timeouts.create']);

// If the password_mode is manual, do not send an email to set it. Else, send the email.
if (!isset($data['value'])) {
if ($data['password'] === '') {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The test failure was actually due to the isset here - it's set to empty string if not set some lines earlier.

// Create and send welcome email with password set link
$message = new TwigMailMessage($this->ci->view, 'mail/password-create.html.twig');

Expand Down Expand Up @@ -786,8 +786,8 @@ public function getModalEditPassword(Request $request, Response $response, $args

// Load validation rules
$schema = new RequestSchema('schema://requests/user/edit-password.yaml');
$schema->set('value.validators.length.min', $config['site.password.length.min']);
$schema->set('value.validators.length.max', $config['site.password.length.max']);
$schema->set('password.validators.length.min', $config['site.password.length.min']);
$schema->set('password.validators.length.max', $config['site.password.length.max']);
$schema->set('passwordc.validators.length.min', $config['site.password.length.min']);
$schema->set('passwordc.validators.length.max', $config['site.password.length.max']);
$validator = new JqueryValidationAdapter($schema, $this->ci->translator);
Expand Down