Ok I figured this out....It wasn't what I thought at all and is a
stupid error, but by sharing maybe I can prevent this from happening
to someone else.
What happened is I had the model registered in my User Controller like
so:
App::import('Model','Realm');
$Realm = new Realm;
This didn't work. When I changed the code to be:
$this->User->Realm->save($data)
it works. So I guess if you have a belongsTo relationship (Realm
belongs to user) in your controller then you cannot use the
App::import and have it always work.
Fred
On Mar 10, 1:19 am, Fred <[email protected]> wrote:
> I am having trouble getting ACL to function properly. Everything works
> as long as you are logged in. However, now I want to dynamically
> create a user when they register (i.e. they aren't logged in). So I
> create the user (that works) and then create a realm (a realm is
> requester for ACL and basically maps users to AROs/permissions). This
> all works until I try to create a new Realm without being logged in
> (this is the only possible difference that I can see). The Realm is
> actually created in the save function, however in the AfterSave call I
> get an error in the acl.php file. I cannot figure out why this is
> happening or how to prevent it. Any help is much appreciated.
>
> Notice (8): Undefined property: Realm::$Aro [CORE\cake\libs\model
> \behaviors\acl.php, line 77]
>
> Fatal error: Call to a member function node() on a non-object in C:
> \xampp\htdocs\ispi\cake\libs\model\behaviors\acl.php on line 77
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---