*

dsf

  • *****
  • 261 posts
PHP 8.0.x fatal Error
« on: May 27, 2023, 01:10:15 PM »
Hi,

After switching to PHP 8, i get some of these:

[24-May-2023 23:57:32 Europe/Athens] PHP Fatal error:  Uncaught TypeError: Cannot access offset of type string on string in /home/oc-includes/osclass/helpers/hUtils.php:64

Line 64 in hUtils.php is:

Code: [Select]
if(@$item["locale"][$locale][$field] <> '') {
I have no idea when this happens and i fail to recreate it, doing all standard things, like login/register and post/edit an ad as a normal user.

Marked as best answer by frosticek on May 30, 2023, 03:08:08 PM
*

MB Themes

Re: PHP 8.0.x fatal Error
« Reply #1 on: May 30, 2023, 09:30:33 AM »
@dsf
You can replace that line with:
Code: [Select]
if(isset($item["locale"]) && isset($item["locale"][$locale]) && isset($item["locale"][$locale][$field]) && $item["locale"][$locale][$field] <> '') {
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

dsf

  • *****
  • 261 posts
Re: PHP 8.0.x fatal Error
« Reply #2 on: May 30, 2023, 09:45:05 AM »
Thank you, i will do that and update here with my findings.

*

dsf

  • *****
  • 261 posts
Re: PHP 8.0.x fatal Error
« Reply #3 on: June 04, 2023, 06:37:09 PM »
So far, so good.

*

MB Themes

Re: PHP 8.0.x fatal Error
« Reply #4 on: June 05, 2023, 10:38:03 AM »
Cool  8)
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots