Hello ...

I think I found a bug in the tree behavior class (SVN 6661) .. it is
triggered when deleting the last (ie bottom node) of a MPTT tree.

Data would be
INSERT INTO `pipelines` (`id`, `parent_id`, `name`, `useraction_id`,
`lft`, `rgt`) VALUES
(1, NULL, 'FRONT', 1, 1, 20),
(2, 1, 'FRONT', 26, 2, 19),
(3, 2, 'FRONT', 27, 3, 8),
(4, 2, 'FRONT', 28, 9, 14),
(5, 2, 'FRONT', 29, 15, 18),
(6, 3, 'FRONT', 30, 4, 7),
(7, 4, 'FRONT', 30, 10, 13),
(8, 5, 'FRONT', 31, 16, 17),
(9, 7, 'FRONT', 31, 11, 12),
(10, 6, 'FRONT', 31, 5, 6);

So when I try to delete ID 8 for example (removefromtree(8,true)) the
method should return after (line 529)

        if ($node[$right] == $node[$left] + 1) {
            if ($delete) {
                $model->delete();
                return true;
            } else {
                return false;
            }

otherwise the beforeDelete gets called twice and the right values
don't match any more.

Am I missing something or is this really a bug?

Wirtsi





--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to