Page 1 of 1

Category created with id 0

Posted: 28 May 2016, 10:39
by Hativ3
Hello,

I use the Phoca Gallery Component 4.3.0 in my Joomla 3.5.1. After I created a category I got several errors on pages of the gallery:
Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 72 bytes) in /administrator/components/com_phocagallery/views/phocagallerycs/view.html.php on line 180

Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 72 bytes) in /components/com_phocagallery/models/categories.php on line 166

Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 27049 bytes) in /administrator/components/com_phocagallery/libraries/phocagallery/html/category.php on line 59
I've checked it and the reason I find out is the creation of an entry in the database table phocagallery_categories with id 0 (though I already have categories with id's from 1 to 14). If I change the ID or remove the entry everything is working fine.

What is going wrong?

(English is not my first language - sorry)

Re: Category created with id 0

Posted: 29 May 2016, 19:45
by Jan
Hi, this message is displayed in case of memory problem, but I don't exactly understand this:

268435456 bytes exhausted (tried to allocate 72 bytes) - it only asked for 72 from 268435456 which means, there must be some other place which needs a lot of memory. :idea:

Next problem is, you get the problem on different places, which means, there is nothing specific which needs a lot of memory - so first you need to discover which part on your server needs to much error so then there is no memory for standard operations :idea:

When I see the rows of the problem, it is always about JObject method, so maybe there will be some problem in Joomla! libraries :idea:

Testing on my php7 server and get no problem. The idea is if you are able to change the code
FROM:
... = new JObject();

TO:
... = new stdClass();

Maybe this can solve the problem.
Jan

Re: Category created with id 0

Posted: 30 May 2016, 07:44
by Hativ3
Thank you for the answer!

I've tried to change JObject(); to stdClass(); but the problem is the same. Also I've tried to change PHP 5.4 to PHP 7, but nothing has changed. And I've set the memory_limit from 256MB to several gigabytes, but again nothing has changed.

I think the main problem is the creation of the category creation with id 0, because the problem only appears if a category width id 0 exists?

:(

Re: Category created with id 0

Posted: 01 Jun 2016, 22:59
by Jan
Hi, yes, but the JObject(); to stdClass(); throws the error which then cause end of the script :idea: Maybe there is some limitation on the server, I am testing both JObject or stdClass - both are standard methods - one of Joomla! second of PHP and get no problems on all of my test servers (include PHP7) :idea: so maybe there is some limitation, maybe protection, on the server :idea:

Jan