I've done a simple "change_email" function with its view and all the stuff in the controller. Everything is actually working fine except saving the data. When I submit my form and my model actually runs its save()-Method CakePHP throws an error:
AclNode::node() - Couldn't find Aro node identified by "Array ( [Aro0.model] => User [Aro0.foreign_key] => 11 ) "
Of course he doesn't find the node, since it hasn't been created (when a user registers his account, a node won't be created automatically). I'm curious about why my model wants to find the node since its not needed for the actual operation.
public function change_email()
{
if ($this->request->is("put")) {
if (!empty($this->request->data)) {
$this->User->validator()
->add('password', array(
'valid' => array(
'rule' => 'validatePassword'
)
))
->add('email_confirm', array(
'valid' => array(
'rule' => 'validateEmail'
)
));
if ($this->User->save($this->request->data)) {
$this->set("status", true);
}
}
}
}
Thats my code in the controller. The model has no real effect except its beforeFilter() method which only hashes the password.
Does anyone have an idea?