baum icon indicating copy to clipboard operation
baum copied to clipboard

makeChildOf() function repeats indexes and returns broken tree

Open matiazar opened this issue 9 years ago • 1 comments

Hi Im new with baum but I have a very simple problem.

I had a new tree (made with rebuild function) so I can check it with isValidNestedSet() function and returns true.

Now, I want to add a new category to the tree. So I create it. $c = new Category($request->all()); $c->save(); if ($request->parent_id == 0) { $c->makeRoot(); } else { $c->makeChildOf($request->parent_id); }

The tree now is showing in perfect condition on screen but it isnt the same on DB. the new record has repeated his left and right indexes from others records. and if I now test the tree with isValidNestedSet() it returns false;

Why? What Im doing wrong ?

Thanks in advance.

matiazar avatar Sep 07 '16 16:09 matiazar

same issue..

aqlx86 avatar Sep 11 '18 06:09 aqlx86