I've just tested your plugin that works well until I try to save the elements of my tree after calling rebuildTree(). Indeed, as my tree is static I do not want to rebuild the tree each time I want to access it. It seems that the lft/rgt field are updated in 'strange' way after saving. For example I have a root node with the correct lft=1 and rgt=14 (my tree has 7 elements) and after saving all elements the values are lft=1 and rgt=26...
I noticed the pre middleware for saving in your plugin but don't exactly understand what it is supposed to do.
Any help is welcome.
Thanks !