I have two custom validation rules (I have tested they work correctly):
class PasswordResetKey extends AppModel {
public $validate = array(
'timestamp' => array(
'rule' => '_notExpired',
'message' => 'Your password reset link has expired. Please request another one.',
'last' => true
),
'key' => array(
'rule' => '_validFormat',
'message' => 'You do not appear to have used a valid password reset link. Please request another one.'
)
);
But no matter what I do, the errors returned are always:
Array
(
[key] => You do not appear to have used a valid password reset link. Please request another one.
[timestamp] => Your password reset link has expired. Please request another one.
)
Even when I check that the timestamp rule fails, it still goes on and checks the other rule for ‘key’ as well. I only want the timestamp error if it is there.
last is for multi rules per field. due to the fact that you only have one rule per field its always last and thus pointless.