Error in PHP 8.0 : 0 Unsupported operand types: int / string

Phoca Gallery - image gallery extension
Johann
Phoca Newbie
Phoca Newbie
Posts: 8
Joined: 10 Aug 2023, 21:54

Error in PHP 8.0 : 0 Unsupported operand types: int / string

Post by Johann »

Hi,

I've been using Phoca Gallery for many years. Thank you for a job well done.

Despite reading all the topics on the error "0 Unsupported operand types: int / string" I haven't found the solution to my problem...

The previous version of my site where everything worked fine was:
Joomla: 3.10.12
PHP: 7.4
Phoca Gallery: 4.4.3

I had to update Joomla and the new version of my site is:
Joomla: 4.3.3
PHP: 8.0
Phoca Gallery: 4.5.4

The category list display works.
But when I click on a category to see the images in the selected category, I can't access the page, and the error page displays "0 Unsupported operand types: int / string".

https://jazcompreparevotresite.com/la-galerie

Which step did I miss?
Thanks for your help.

Tags:
User avatar
Benno
Phoca Hero
Phoca Hero
Posts: 9435
Joined: 04 Dec 2008, 11:58
Location: Germany
Contact:

Re: Error in PHP 8.0 : 0 Unsupported operand types: int / string

Post by Benno »

Hi,
Which step did I miss?
Did you follow this migration guide?
https://www.phoca.cz/documentation/86-j ... o-joomla-4

Kind regards,
Benno
Johann
Phoca Newbie
Phoca Newbie
Posts: 8
Joined: 10 Aug 2023, 21:54

Re: Error in PHP 8.0 : 0 Unsupported operand types: int / string

Post by Johann »

Thank you for your quick reply,
I have just reproduced exactly the procedure indicated in the migration guide. The result is the same... The category view is displayed correctly, but I can't access the images in the selected category: "0 Unsupported operand types: int / string"

what's wrong?
Johann
Phoca Newbie
Phoca Newbie
Posts: 8
Joined: 10 Aug 2023, 21:54

Re: Error in PHP 8.0 : 0 Unsupported operand types: int / string

Post by Johann »

I exported the [images/phocagallery] folder and the phacagallery tables (except _style) from my php7.4 site A (joomla 3.10.12 & phocagallery 4.4.3) .
I cleaned up the phocagallery tables on my test site B (except _style) which is configured in php8 with joomla 4.3.3 and phocagallery 4.5.4.
Then I imported the site tables from site A to site B.
I got exactly the same error!
please, what can i do ???
I tried with another template (Cassiopeia), same thing... that's not where the problem comes from.
What's going on with Phocagallery in php8?!
Thank you for listening and for your support.
Johann
Phoca Newbie
Phoca Newbie
Posts: 8
Joined: 10 Aug 2023, 21:54

Re: Error in PHP 8.0 : 0 Unsupported operand types: int / string

Post by Johann »

Any idea? can you reproduce this error ?
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48386
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Error in PHP 8.0 : 0 Unsupported operand types: int / string

Post by Jan »

Hi, first of all, enable debug mode to see complete error message.

This: "0 Unsupported operand types: int / string" says nothing. When you enable debug mode, then you will see the complete error message including file path and line where this error exactly occurs. Then we will be a little more smarter.

Jan
If you find Phoca extensions useful, please support the project
Johann
Phoca Newbie
Phoca Newbie
Posts: 8
Joined: 10 Aug 2023, 21:54

Re: Error in PHP 8.0 : 0 Unsupported operand types: int / string

Post by Johann »

Thank you Jan,
I have just activate the debug mode.
You can see all result on this page after having sectected one category.
https://jazcompreparevotresite.com/la-galerie
Thank you for you feedback ;-)
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48386
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Error in PHP 8.0 : 0 Unsupported operand types: int / string

Post by Jan »

Hi,

what value is the parameter: Pagination Default Value (Category View) in your Phoca Gallery Options?

Jan
If you find Phoca extensions useful, please support the project
Johann
Phoca Newbie
Phoca Newbie
Posts: 8
Joined: 10 Aug 2023, 21:54

Re: Error in PHP 8.0 : 0 Unsupported operand types: int / string

Post by Johann »

The value for Pagination Default Value (Category View) is: all
Please, how can I send you the file components/com_phocadownload/models/category.php ? There is no possibility for attached file actually ?!
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48386
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Error in PHP 8.0 : 0 Unsupported operand types: int / string

Post by Jan »

Hi, no need the file anymore. The "all" is wrong value, there should be number. If you want to display all images (which is normally not recommended), just set some high number there (such number needs to be even included in pagination values).

Jan
If you find Phoca extensions useful, please support the project
Post Reply