Page 1 of 1

Warnings after PHP change

Posted: 11 Jan 2022, 19:20
by KarEm
Hello Jan,
I have updated my XAMPP configuration to:
Joomla 3.10.4
PHP 8.0.14
PG is on V 4.4.3

Due to the change to PHP 8.x, two warnings were issued:

Warning: attempting to access an array offset to a value of type int in ...xampp\htdocs\hp_joomla1\administrator\components\com_phocagallery\libraries\phocagallery\imagefront.php on line 402

Deprecated: Required parameter $treeId follows optional parameter $id in ...xampp\htdocs\hp_joomla1\modules\mod_phocagallery_tree\mod_phocagallery_tree.php on line 135

The following change fixed this warning:
function categoryTreePGTM( $data, $tree, $id = 0, $text = '', $treeId) {
change to:
function categoryTreePGTM( $data, $tree, $id = 0, $text = '', $treeId = 0) {

Could you please check if this is ok?

Is there a fix for the first warning? If so, If so, I offer to test it.

Thanks in advance

Regards
KarEm

Re: Warnings after PHP change

Posted: 11 Jan 2022, 19:27
by Jan
Hi, thank you for the info. Because these are warnings, they have in fact low priority (as warnings and notices can be easily disabled in Joomal configuration). I will take a look at it but the advice is just simple. If you run the latest PHP (PHP8) then run even the latest Joomla (Joomla 4) and Phoca Gallery (event it is still Beta).

Phoca Gallery is in Beta version (but in fact this is stable as I don't have an fix in the front):

https://www.phoca.cz/demo/
https://www.phoca.cz/wallpapers/
https://www.phoca.cz/phocacart4demo/phoca-gallery

But back to topic, yes, your fixes are correct. So I will include them in next release.

Thank you, Jan

Re: Warnings after PHP change

Posted: 11 Jan 2022, 20:15
by KarEm
Hi Jan,
thanks for the quick reply and confirmation.
Yes, they are only warnings and I am aware of the disable possibilities.

I want to stay with the active pages on Joomla 3.x for a while and test in parallel J4 and PG4 under PHP 8.x on XAMPP.

If you have a fix, please let me know.

Regards
KarEm

Re: Warnings after PHP change

Posted: 11 Jan 2022, 21:10
by Jan
Hi, just add following code before the line 402:

Code: Select all

if (!is_array($categoryImageOrdering) && is_numeric($categoryImageOrdering)) {
            $categoryImageOrdering = PhocaGalleryOrdering::getOrderingString($categoryImageOrdering);
        }

Re: Warnings after PHP change

Posted: 11 Jan 2022, 23:28
by KarEm
Hi Jan,

done and works as expected.

Great!

Many thanks for this quick fix.

Regards
KarEm

Re: Warnings after PHP change

Posted: 11 Jan 2022, 23:30
by Jan
Ok