Page 1 of 1

Attempt to assign property "children" on null

Posted: 30 Aug 2023, 00:45
by gardlik@epona.cz
Hi, can I get your advice on Attempt to assign property "children" on null.
(Joomla! Version 4.3.4 PHP Version 8.2.1)
After updating Phoca Gallery from 4.5.3 to 4.5.4 if I select images in the control panel there is an error:
(It is the same when choosing Rating)

Attempt to assign property "children" on null
.../administrator/components/com_phocagallery/models/fields/phocagallerycategory.php:97
92 $categories = $db->loadObjectList('id') ?? [];
93
94 array_walk($categories, function ($category) use ($categories) {
95 if ($category->parent_id) {
96 if ($categories[$category->parent_id]->children === null)
97 $categories[$category->parent_id]->children = [];
98 $categories[$category->parent_id]->children[] = $category;


Thank you so much for your help

Re: Attempt to assign property "children" on null

Posted: 04 Sep 2023, 14:05
by Jan
Hi, where exactly do you get this problem? Can you paste a screenshot so I can test it.

BTW which version of database you are using, the SQL query there:

'SELECT a.*, null AS children FROM #__phocagallery_categories AS a ORDER BY a.ordering, a.id'

just initializes the "children" property, so there should not be an yproblem with "children"?


Thank you, Jan

Joomla 4.4.5 - Attempt to assign property "children" on null

Posted: 24 Jun 2024, 17:30
by XavierM
Hi Jan,

I would highly appreciate your help for the message "Attempt to assign property "children" on null" appearing on access to admin menu Components / Phoca galery / Images.

We have just migrated to Joomla4 the website in a test environment : https://lcso.longecotelessablesdolonne.fr/

I would be happy to enclose:
. an image of the configuration (PHP version, Maris DB Version).
. an image of debug messages, of course we can send you super user credentials.
but I don't understand how to upload in Imgur website.

Moreover Phoca Galery pages are displayed badly => https://lcso.longecotelessablesdolonne. ... udalmezeau

Many thanks in advance for your help.

Best regards.
Xavier

Re: Attempt to assign property "children" on null

Posted: 26 Jun 2024, 01:15
by Jan
Hi, you need to enable debug mode to get the whole error message including the trace to see which file the error is coming from.

Jan