Jump to content

regenerateEntireNTree doesn't do anything


twothirds

Recommended Posts

Hi,

 

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:

include('config/config.inc.php');
include('init.php');

try {
  Category::regenerateEntireNtree();
} 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

  • 9 years later...

The comment about this forum being only Prestashop USERS... Seems more than a few people don't understand "the forums". JS

I ended up here searching explicitly for developer solutions to a very similar problem... PS Forums have been helpful in the past, and I get they want to bury PS 1.6 in favor of their new stripped down code model, but it is my opinion that the release of the PS 1.6.x codebase is what truly put Prestashop on the map, so to speak, and they have behaved poorly with how customer service and technical support has been provided for that codebase. After all, much of the code was donated - for FREE! I get the Open-Source market is a tough "place" to create a profitable enterprise from, and in my opinion, the ONLY group that seems to have done it correctly are the folks behind Linux. But I digress...

image.thumb.png.4dbaec7797bba4c96bf0e53c278abf43.png

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...