Bug Report #3586
The validation exception does not properly namespace errors
| Status: | Closed | Start date: | 01/14/2011 | |
|---|---|---|---|---|
| Priority: | High | Due date: | ||
| Assignee: | % Done: | 0% |
||
| Category: | - | |||
| Target version: | Kohana v3.x - v3.1.0 | |||
| Resolution: | fixed | Points: |
Description
$e->errors('directory'); is completely broken at the moment. Seems some code refactoring broke the feature.
Given the following errors from the User model:
array(
'username' => 'not_empty',
'user_profile' => array(
'first_name' => 'max_length',
),
);
$e->errors('model-validation'); should check the following paths in order and stop as soon as a value is found (last one on the list is the default text returned):
array(
// messages/user.php
// username.not_empty
// username.default
// not_empty
// messages/validation.php
// not_empty
// 'user.username.not_empty'
'username' => 'not_empty',
'user_profile' => array(
// messages/user/user_profile.php
// first_name.max_length
// first_name.max_length
// max_length
// messages/validation.php
// max_length
// 'user.username.not_empty'
'first_name' => 'max_length',
),
);
I will fix this in a pull request today
Associated revisions
Fixed the recursive generate_errors() method for orm validation exceptions, fixes #3586
History
Updated by Isaiah DeRose-Wilson over 1 year ago
- Status changed from New to Closed
- Resolution set to fixed
Fixed by b717bb7033...