Bug Report #4432
Fix 'password confirm' error message in ORM module
|Assignee:||Lorenzo Pisani||% Done:||
When using the get_password_validation() rules for validation a password_cofirm field, the error message returned is "password confirm must be the same as password confirm".
In the ORM module, the user model sets the password_confirm rule as follows:
return Validation::factory($values) ->rule('password', 'min_length', array(':value', 8)) ->rule('password_confirm', 'matches', array(':validation', ':field', 'password'));
The 'matches' validation message is ':field must be the same as :param2', see here https://github.com/kohana/core/blob/3.3/develop/messages/validation.php#L18
Without digging too deep in the validation classes, it appears the issue here is the order of the validation fields.
To keep the messages consistant, I think we should make a small adjustment to the model class to adjust the order of the fields passed into the validation rule.
Updated by Richard Willis over 1 year ago
Blast, I'm sorry for creating this issue in the wrong section. Please let me know if I should recreate this issue for the k3-orm project.
Pull request here: https://github.com/kohana/orm/pull/55
Updated by Isaiah DeRose-Wilson about 1 year ago
- Status changed from New to Assigned
- Assignee set to Isaiah DeRose-Wilson
- Target version set to v3.3.0
- Points deleted (
Updated by Lorenzo Pisani 8 months ago
- Status changed from Assigned to Closed
- Assignee changed from Isaiah DeRose-Wilson to Lorenzo Pisani
- % Done changed from 0 to 100
- Resolution set to fixed
I think it makes more sense to fix it by adjusting the message file. The matches method takes three parameters: $array, $field, $matches so the third parameter is the one you are matching, not the second.