Jump to content

[SOLVED] Regenerate category tree module : Fatal error: Allowed memory size of 1342177280 bytes exhausted


kevinberben
 Share

Recommended Posts

Hello,

 

 

I try to use the Regenerate Category Module, but I have this error message : 

Fatal error: Allowed memory size of 1342177280 bytes exhausted (tried to allocate 262144 bytes) in /home/clients/0e92a284cc2f72d4c65f0ef91cf33c87/web/classes/Category.php on line 431

[PrestaShop] Fatal error in module file :/home/clients/0e92a284cc2f72d4c65f0ef91cf33c87/web/classes/Category.php:
Allowed memory size of 1342177280 bytes exhausted (tried to allocate 262144 bytes)

 

I try to unlock the server limit (My hosting is Infomaniak.com).

I also try to increase the limite in config.inc.php.

 

But it doesn't work.

 

 

Sorry for my bad english...

Can someone help me?

 

Thanks,

 

Kevin

 

 

Edited by kevinberben (see edit history)

Share this post


Link to post
Share on other sites

  • 3 weeks later...

And now another problem.

I use this : 

Db::getInstance()->execute('UPDATE `ps_category` SET `nleft`=0,`nright`=0 WHERE 1');
Category::regenerateEntireNtree();

 

Now each nleft and Nrights are on 0. But the catagory regeneration does not work.
I try to use the Regenerate Category Tree module. When I regenerate, it does not work too. Nothing change in the database and no error message.
 

 

Maybe a problem in my pq_category table?
Can someone help me?

 

Thanks,

Kev

Share this post


Link to post
Share on other sites

SOLVED!

 

The problem was in the regenerateEntireNtree() function that works with a condition. 
In ps_category > The root category must be 0. In my table, it was 1.

 

So I edit the function like this (in classes/category.php)  (line 421 for me)

if (isset($categories_array[0]) && $categories_array[1]['subcategories']) 

 

and launch the category tree regenerator module.

It works fine.

 

My PS version is 1.6.

Share this post


Link to post
Share on other sites

  • 3 years later...

Hi,

 

Does someone have more specific details about that operation? I need to regenerate my categories tree on my prestashop 1.7.5.2 but I don't understand where I should input

Db::getInstance()->execute('UPDATE `ps_category` SET `nleft`=0,`nright`=0 WHERE 1'); Category::regenerateEntireNtree();

or even just Category::regenerateEntireNtree();

I've put into a random module php file and call the url but nothing happen.

Best regards,

Clément

Share this post


Link to post
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
 Share

×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More