etrepat / baum

Baum is an implementation of the Nested Set pattern for Laravel's Eloquent ORM.
http://etrepat.com/baum
MIT License
2.24k stars 459 forks source link

Why are lft/rgt/depth always null? #260

Closed fzyzcjy closed 7 years ago

fzyzcjy commented 7 years ago

When I use create or other methods, the lft/rgt/depth of the newly created node is always null, but the parent_id and so on are very normal. Then if I use getDescendantsAndSelf and so on, I will get an exception because of the null columns. Only if I use rebuild() will all the nodes have not-null normal values. But then if I create() a new node the columns of it are still null. Looking forward to your reply!

fzyzcjy commented 7 years ago

Any help?? Thanks!!

egitimplus commented 7 years ago

i have same problem

fzyzcjy commented 7 years ago

@egitimplus have you solved it

egitimplus commented 7 years ago

@turtlegood not yet. this problem is new for me. i didnt see it before. i think some packages has cause that.

For now, i call manually rebuild() if lft / right/ depth is null.

fzyzcjy commented 7 years ago

Finally I used another library: laravel-nestedset and it works well. By the way, baum has another issue: there will be deadlocks sometimes.