Hi,
When creating Aro's with parent_id's, the lft column in the tree is
invalid. Here is the code:
$this->Acl->Aro->create();
$this->Acl->Aro->save(array('alias' => 'All'));
$parent_id = $this->Acl->Aro->getLastInsertID();
$this->Acl->Aro->create();
$this->Acl->Aro->save(array('alias' => 'User', 'parent_id' =>
$parent_id));
$this->Acl->Aro->create();
$this->Acl->Aro->save(array('alias' => 'Guest', 'parent_id' =>
$parent_id));
It generates this tree:
(5)All(6)
(4)User(3) (4)Guest(5)
when it should generate this:
(1)All(6)
(2)User(3) (4)Guest(5)
I've been able to localize the problem to this two queries that are
run after the 2nd Aro->save():
SELECT "Aro"."id" AS "Aro__id" FROM "aros" AS "Aro" WHERE "Aro"."lft"
>= '2';
UPDATE "aros" SET "lft" = lft + 2;
As I see it, the first query should select the newly created Aro (in
this case the 'User') with empty 'lft' field and return its id so the
second query can use it.
Can anyone confirm this problem and the faulty tree generation, or am
I missing something here?
Tested on PHP5 and PostgreSQL 8.2 using nightly build of 13.04.2008.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake
PHP" 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
-~----------~----~----~----~------~----~------~--~---