ARO 오류의 사용자 레코드 결과 업데이트 2.3.0을-RC1CakePHP는 2.0 ACL - 내가 CakePHP의에서 ACL을 사용하고
나는 사용자 필드 (마케팅의 optin) 나는 오류 얻을 업데이트 할 때 :
AclNode::node() - Couldn't find Aro node identified by "Array ([Aro0.model] => User[Aro0.foreign_key] => 4) "
을
저는 이것이 사용자를 저장하는 것과 관련이 있다고 생각합니다. 이 문제를 해결하는 방법에 대해서는 매뉴얼에서 찾을 수 없습니다.
$me = $this->Session->read('Auth.User');
// don't use the session to display, because they might have subscribed/unsubscribed
$user = $this->User->find('first',array('conditions'=>array('User.id'=>$me['id'])));
$optin = ! $user['User']['optin'];
$data = array(
'User' => array(
'id' => $me['id'],
'optin' => $optin
)
);
if ($this->User->save($data))
{
$this->Session->setFlash(__('Subscription status has been amended'));
}
else
{
$this->Session->setFlash(__('The user could not be saved. Please, try again.'));
}
$this->redirect(array('action'=>'account'));
나는 ARO 오류가 리디렉션 후 : 여기
는 컨트롤러에서 냈다 방법입니다.
Aro를 사용하지 않았지만 페이지의'debug ($ aro);'가 잘못된 데이터를 포함하는 배열입니까? – Grambot
사용자에게 해당 개체에 대한 acl 항목이없는 것 같습니다. –
@ColbyGuyer가 정확합니다. 사용자가 ARO 레코드를 찾을 수 없으므로 ACL 확인시 오류를 throw합니다. 일반적으로 ACL 설정에서 User 모델에는 ARO를 추가하는 afterSave가 있습니다. 그것이 일어나고 있는지 확인하십시오. – jeremyharris