When I want to switch the store view under Catalog->Manage Categories, from "All store views" to a specific one, I always get this exception:

 Call to a member function getId() on null in
 <magento_path>/lib/Varien/Data/Tree/Dbp.php on line 331.

 328   public function loadEnsuredNodes($category, $rootNode)
 329   {
 330        $pathIds = $category->getPathIds();
 331        $rootNodeId = $rootNode->getId();

$rootNode is null but should be an object. I need to get to know why. I've been also resetting the categories using this sql script


but the problem still exists.

  • If you can't solve it, maybe you shoudn't try recreating categories with sql. Just truncate all the the category tables and recreate manually. I don't know if you added / changed category attributes. If you dit that delete your category flat index so it gets recreated when indexing with the new columns. If all of the above still doesn't work you could try a database repair on a fresh newly installed database (same magento version). One of these things must work otherwise you have some bad code somewhere in your shop. I'm out of characters, google magento database repair and you'll find it. – FROSIT Sep 25 '15 at 9:38
  • I've got a theme which comes with a whole database dump, for demo and I've been using that. I think that dump was not ok. It's also possible that the dump which has been built from a Magento shop is not compatible with Magento Well, I've been reinstalling the shop and the problem is gone. – Artisan72 Sep 27 '15 at 19:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.