Jump to content

regenerateEntireNTree doesn't do anything


Recommended Posts



I have to fix the categories on a prestashop which are displayed in a weird way. When I check the database, the nleft and nright of the categories which are displayed in a wrong way are set to what seems to be a random pair of number or all at 0.


So I guessed the problem come from the N-Tree of those categories and wanted to rebuild it.


The problem I have is that either I create, delete or modify a category, the N-Tree does not seem to be rebuilt. So I wanted to call the function used to rebuild the N-Tree via a script. i used:


try {
} catch (CategoryException $e) {
  echo $e->getMessage();

But the problem is that it does not fix anything. The script seems to do nothing at all, given how much time it takes to be executed!


What should I do ?

Link to comment
Share on other sites

It looks like you don't understand this forum. It is a forum of Prestashop users. The developers of the source code are not on this forum. So the knowledge that we have of the source code is fragmental and restricted to areas that we happened to work on.


I am a bit amazed that you came this far and didn't go one step further to place some debug code in regenerateEntireNtree() to see what actually is happening when you execute it. One possible explanation is that your shop is missing the category with id_category=0 that this function needs to start.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Create New...