Closed bethrezen closed 12 years ago
for sure not a feature, should be fixed, thanks.
I think the way of correcting ID's will be not correct, while it breaks continuous auto_increment for id. So the best way to fix is to check children count and maybe cache it to static variable.
Invalid, there is no this bug. Try to use latest release. $node2->isLeaf() returns true and it's lft=2 and rgt=3.
Assume we have tree: 1 ---2 ------3 ------4 ------5
After calling deleteNode() on (3,4,5) the node 2 has lft 2 and rgt 5. Checking $node2->isLeaf() will return false, because 5-2!==1
I've used isLeaf to render correctly jsTree with folders and files. When $node->isLeaf()==true - it's a file. So I have to use $node->children()->count()==0 instead of $node->isLeaf()
Is it a bug of isLeaf() or deleteNode(), OR is it a feature?