TIP: Use Markdown or, <pre> for multi line code blocks / <code> for inline code.
These forums are read-only and for archival purposes only!
Please join our new forums at discourse.kohanaframework.org
Valid::matches usage and messages
  • Hi all,

    I think I've found a bug unless this is by design: In modules/orm/classes/model/auth/user.php we have ->rule('password_confirm', 'matches', array(':validation', ':field', 'password'))

    Under system/messages/validation.php we have the following message 'matches' => ':field must be the same as :param2',

    So turns out in whenever this error happens, ':field' is param2 and 'password' is param3. Hence the message displayed will be password confirm must be the same as password confirm

    Now of course the immediate workaround for this problem is to reverse the order I pass values into the rule array, but isn't it a bit wrong to require the caller/user of 'matches' to call it using a specific order so that the error messages will make sense??

    Maybe there is somewhere more suitable way to fix the problem but I propose the fix to be editing system/messages/validation.php so that it becomes: 'matches' => ':param2 must be the same as :param3',

  • Cool! Hmm.... but this still seems to be quite restrictive forcing users to have to use ':field' first in param2 and the other value in param3.. orders shouldn't matter should it?

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion