Bug Report #4426

Validation should always run in a model isn't valid

Added by Isaiah DeRose-Wilson 4 months ago.

Status:Closed Start date:01/30/2012
Priority:Normal Due date:
Assignee:Isaiah DeRose-Wilson % Done:

100%

Category:-
Target version:Kohana v3.x - v3.3.0
Resolution:fixed Points:1

Description

「$this->_valid」expression should be run before 「$this->_changed」or missing validation like 「password」 matchs 「password_confirm」in method update()

funciton action_change_password(){
    $_POST["password"] = "12345678";
    $_POST["password_confirm"] = "12345678";
    $user = ORM::factory("user", 1);
    try
    {
        $user->update_user($_POST, array('password'));
        echo "update success";
    }
    catch (ORM_Validation_Exception $exc)
    {
        print_r($exc->errors(''));
    }
    exit;
}

It's still "update success" when password don't match passowrd_confirm after once match success.

Related issues

related to ORM - Bug Report #4425: Validation should always run in a model isn't valid Kohana v3.x - v3.2.1 Closed 01/30/2012

Also available in: Atom PDF