Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8857251
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T14:32:44+00:00 2026-06-14T14:32:44+00:00

as the title already says I’ve got a problem with the Acl Tutorial of

  • 0

as the title already says I’ve got a problem with the Acl Tutorial of CakePHP 2.
I’ve done everything exactly the way it is mentioned in the Tutorial, but still it doesn’t work.

I know that there are many people on the internet which have also a problem with this tutorial, but I can’t find any blog entry or whatever with the same problem like me.
When I try to access a direction of my app I get the following error:

Notice (8): Undefined index: group_id [APP\Model\User.php, line 98]

and:

AclNode::node() - Couldn't find Aro node identified by "Array ( [Aro0.model] => Group [Aro0.foreign_key] => ) "

So there isn’t any value for the foreign_key transmitted to the Acl at all.
But the strange thing is that -at least in the functions of the userscontroller- the foreign_key is set properly but when it should be passed to the Acl it is gone

Nr  Query   Error   Affected    Num. rows   Took (ms)

1   SELECT COUNT(*) AS `count` FROM `cake`.`users` AS `User` WHERE `User`.`id` = 4
2   SELECT COUNT(*) AS `count` FROM `cake`.`users` AS `User` WHERE `User`.`id` = 4
3   SELECT COUNT(*) AS `count` FROM `cake`.`users` AS `User` WHERE `User`.`id` = 4
4   UPDATE `cake`.`users` SET `modified` = '2012-11-13 19:59:47' WHERE `cake`.`users`.`id` = '4'
5   SELECT `User`.`group_id` FROM `cake`.`users` AS `User` WHERE `User`.`id` = 4 LIMIT 1
6   SELECT `Aro`.`id`, `Aro`.`parent_id`, `Aro`.`model`, `Aro`.`foreign_key`, `Aro`.`alias` FROM `cake`.`aros` AS `Aro` LEFT JOIN `cake`.`aros` AS `Aro0` ON (`Aro`.`lft` <= `Aro0`.`lft` AND `Aro`.`rght` >= `Aro0`.`rght`) WHERE `Aro0`.`model` = 'Group' AND `Aro0`.`foreign_key` = 2 ORDER BY `Aro`.`lft` DESC
7   SELECT `Aro`.`id`, `Aro`.`parent_id`, `Aro`.`model`, `Aro`.`foreign_key`, `Aro`.`alias` FROM `cake`.`aros` AS `Aro` LEFT JOIN `cake`.`aros` AS `Aro0` ON (`Aro`.`lft` <= `Aro0`.`lft` AND `Aro`.`rght` >= `Aro0`.`rght`) WHERE `Aro0`.`model` = 'User' AND `Aro0`.`foreign_key` = 4 ORDER BY `Aro`.`lft` DESC
8   SELECT COUNT(*) AS `count` FROM `cake`.`aros` AS `Aro` WHERE `Aro`.`id` = 6
9   SELECT COUNT(*) AS `count` FROM `cake`.`aros` AS `Aro` WHERE `Aro`.`id` = 6
10  SELECT `Aro`.`parent_id` FROM `cake`.`aros` AS `Aro` WHERE `Aro`.`id` = 6 LIMIT 1
11  SELECT `Aro`.`id`, `Aro`.`parent_id`, `Aro`.`lft`, `Aro`.`rght` FROM `cake`.`aros` AS `Aro` WHERE 1 = 1 AND `Aro`.`id` = 6 LIMIT 1
12  SELECT `Aro`.`id`, `Aro`.`lft`, `Aro`.`rght` FROM `cake`.`aros` AS `Aro` WHERE 1 = 1 AND `Aro`.`id` = 2 LIMIT 1
13  SELECT COUNT(*) AS `count` FROM `cake`.`aros` AS `Aro` WHERE `Aro`.`id` = 6
14  UPDATE `cake`.`aros` SET `parent_id` = 2, `model` = 'User', `foreign_key` = 4, `id` = 6 WHERE `cake`.`aros`.`id` = '6'
15  SELECT `Aro`.`id`, `Aro`.`parent_id`, `Aro`.`model`, `Aro`.`foreign_key`, `Aro`.`alias` FROM `cake`.`aros` AS `Aro` LEFT JOIN `cake`.`aros` AS `Aro0` ON (`Aro`.`lft` <= `Aro0`.`lft` AND `Aro`.`rght` >= `Aro0`.`rght`) WHERE `Aro0`.`model` = 'Group' AND `Aro0`.`foreign_key` IS NULL ORDER BY `Aro`.`lft` DESC

The lines from the error message are:

public function bindNode($user) {
    return array('model'=>'Group','foreign_key'=>$user['User']['group_id']);
}

So why is the value of the foreign_key firstly ‘2’ (how it is supposed to be) and afterwards NULL ?

I hope some of you are able to help me.
Thanks.

PS: For everyone who would prefer the german version of my question, here it is

UPDATE:
I was able to make it work for all functions of the userscontroller through this:

public function bindNode() {
    $this->id;
    $data = $this->read();
    return array('model' => 'Group', 'foreign_key' => $data['User']['group_id']);
    }

But for all other Controllers its still the same..
Has any one an idea how i could get the users data in the model, so that it works also for the other controllers?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T14:32:45+00:00Added an answer on June 14, 2026 at 2:32 pm

    I know its a bit stupid to answer my own question, but instead of deleting the question i think it would be better to leave it here for anybody who has the same problem, because there seems to be no answer for this on the internet.

    I was able to solve the problem through the following code:

    public function bindNode() {
        $data = AuthComponent::user();
        return array('model' => 'Group', 'foreign_key' => $data['User']['group_id']);
        }
    

    It seems to work perfectly, and maybe it could help some others 😉

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

The title already says a lot, but basically what i want to do is
I believe the title already says it all, but here is my question: what
as already the title of my question says I have the problem that the
as the title already says, I want to execute a linux comand with a
as the title already says... I'd like to open a ElementTreeSelectionDialog with the Tree
I just want what my title says.I have already read all the previous similar
There are already several questions with a similar title, but they received either no
Please don't confuse with the title as it was already asked by someone but
The problem is in the title, I'll try to list what I've already tried
As the title already says, I would like to know if it is somehow

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.