Jump to content

Possible Memory Leak on CategoryDataProvider.php ?


Panther.software

Recommended Posts

Hello,

after upgrading from 1.6 to 1.7 whenever I tried to edit product all I get is Exception Page:

  Quote

(1/1) OutOfMemoryException

Error: Allowed memory size of 1073741824 bytes exhausted (tried to allocate 1073741832 bytes)

in CategoryDataProvider.php line 206
Expand  

1GB is allocated to this vHost so it's not possible that is too low, I tried with 2GB - same things.
Categories count: 232

Please let me know if you can help me.

Link to comment
Share on other sites

  • 3 months later...
  • 3 weeks later...

Hello,

Edit file CategoryDataProvider.php and try to change getBreadCrumb method to this :

        /**
         * Construct the breadcrumb using the already constructed list of all categories.
         *
         * @param int $categoryId
         * @param string $delimiter
         *
         * @return string
         */
        public function getBreadCrumb($categoryId, $delimiter = ' > ')
        {
            return false;
            $categories = $this->getParentNamesFromList($categoryId);
            $categories = array_reverse($categories, true);

            return implode($delimiter, $categories);
        }

 

Link to comment
Share on other sites

  On 5/3/2019 at 11:02 AM, cyssoo said:

Hello,

Edit file CategoryDataProvider.php and try to change getBreadCrumb method to this :

        /**
         * Construct the breadcrumb using the already constructed list of all categories.
         *
         * @param int $categoryId
         * @param string $delimiter
         *
         * @return string
         */
        public function getBreadCrumb($categoryId, $delimiter = ' > ')
        {
            return false;
            $categories = $this->getParentNamesFromList($categoryId);
            $categories = array_reverse($categories, true);

            return implode($delimiter, $categories);
        }

 

Expand  

Hi, i have the same error.

i made this and i get a FatalThrowableError:

DebugClassLoader->loadClass('PrestaShop\\PrestaShop\\Adapter\\Category\\CategoryDataProvider')

Link to comment
Share on other sites

  • 1 year later...

This works for me in prestashop 1.7.6.5

  On 5/3/2019 at 11:02 AM, cyssoo said:

Hello,

Edit file CategoryDataProvider.php and try to change getBreadCrumb method to this :

        /**
         * Construct the breadcrumb using the already constructed list of all categories.
         *
         * @param int $categoryId
         * @param string $delimiter
         *
         * @return string
         */
        public function getBreadCrumb($categoryId, $delimiter = ' > ')
        {
            return false;
            $categories = $this->getParentNamesFromList($categoryId);
            $categories = array_reverse($categories, true);

            return implode($delimiter, $categories);
        }

 

Expand  

 

Link to comment
Share on other sites

  • 5 months later...
  On 5/3/2019 at 11:02 AM, cyssoo said:

Hello,

this worked for me tto in PS 1.7.5.0

Many thank to cyssoo for this solution.

        /**
         * Construct the breadcrumb using the already constructed list of all categories.
         *
         * @param int $categoryId
         * @param string $delimiter
         *
         * @return string
         */
        public function getBreadCrumb($categoryId, $delimiter = ' > ')
        {
            return false;
            $categories = $this->getParentNamesFromList($categoryId);
            $categories = array_reverse($categories, true);

            return implode($delimiter, $categories);
        }

 

Expand  

 

Link to comment
Share on other sites

  • 2 months later...

I have the same error. I applied the correction here but it did not work.

Do I have to do something after modifying the code?

I have about 600 categories.

Do I have to delete the categories and create them again after modifying the code?

Any more ideas?

Prestashop versione 1.7.6.5

 

Cuando activo el modo de depuración, obtengo esto cuando intento modificar un producto

 

(1/1) OutOfMemoryException

Error: memoria insuficiente (asignada 703070208) (intentado asignar 20480 bytes)

en FormDataExtractor.php línea 55

2021-01-08_05h40_15.jpg

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