DoctrineExtensions: Moving a root node up/down throws an error

I’ve got a tree with several root node elements using the nested tree behaviour but when I try to move one of these root level nodes up a level things go borked.

Error: Cannot get siblings from tree root node

#0 /vagrant/src/vendor/gedmo/doctrine-extensions/lib/Gedmo/Tree/Entity/Repository/NestedTreeRepository.php(421): Gedmo\Tree\Entity\Repository\NestedTreeRepository->getNextSiblingsQueryBuilder(Object(Rocket\Entity\Category), false)
#1 /vagrant/src/vendor/gedmo/doctrine-extensions/lib/Gedmo/Tree/Entity/Repository/NestedTreeRepository.php(433): Gedmo\Tree\Entity\Repository\NestedTreeRepository->getNextSiblingsQuery(Object(Rocket\Entity\Category), false)
#2 /vagrant/src/vendor/gedmo/doctrine-extensions/lib/Gedmo/Tree/Entity/Repository/NestedTreeRepository.php(522): Gedmo\Tree\Entity\Repository\NestedTreeRepository->getNextSiblings(Object(Rocket\Entity\Category))
#3 /vagrant/src/application/services/Category.php(65): Gedmo\Tree\Entity\Repository\NestedTreeRepository->moveDown(Object(Rocket\Entity\Category), 1)
#4 /vagrant/src/application/modules/backend/controllers/CategoriesController.php(75): Rocket_Service_Category->moveCategoryDown(Object(Rocket\Entity\Category))
#5 /vagrant/src/vendor/breerly/zf1/library/Zend/Controller/Action.php(516): Backend_CategoriesController->movedownAction()
#6 /vagrant/src/vendor/breerly/zf1/library/Zend/Controller/Dispatcher/Standard.php(295): Zend_Controller_Action->dispatch('movedownAction')
#7 /vagrant/src/vendor/breerly/zf1/library/Zend/Controller/Front.php(954): Zend_Controller_Dispatcher_Standard->dispatch(Object(Zend_Controller_Request_Http), Object(Zend_Controller_Response_Http))
#8 /vagrant/src/vendor/breerly/zf1/library/Zend/Application/Bootstrap/Bootstrap.php(97): Zend_Controller_Front->dispatch()
#9 /vagrant/src/vendor/breerly/zf1/library/Zend/Application.php(366): Zend_Application_Bootstrap_Bootstrap->run()
#10 /vagrant/src/public/index.php(43): Zend_Application->run()
#11 {main}

About this issue

  • Original URL
  • State: closed
  • Created 12 years ago
  • Comments: 20 (8 by maintainers)

Most upvoted comments

do not use root at all, in that case you will be able to move lowest level nodes

do not use root at all, in that case you will be able to move lowest level nodes

@l3pp4rd That comment saved my day (I was ready to move everything to a single root node). Maybe it would be worth adding a hint to the following error message:

Cannot persist sibling for a root node, tree operation is not possible