Welcome, Guest
Username: Password: Remember me

TOPIC: PHP 8 Compatibitility

PHP 8 Compatibitility 24 Mar 2022 03:03 #15930

  • organicwebs
  • organicwebs's Avatar
  • Offline
  • Premium Member
  • Chris
  • Posts: 133
  • Thank you received: 20
  • Karma: 7
There are going to be a few PHP 8 incompatibilties - so this is probably the place to note them down.
Please add to this list if you find any ... JCook is not being developed anymore - so we need to help each other to keep our older websites running.

If you upgrade to PHP 8 and your whole website goes down... its is probably line 384 in libraries/jdom.php (which is loaded for eevry page).

If you swicth on the Joomla Degug mode, you will see this error...
"count(): Argument #1 ($value) must be of type Countable|array, null given"
This is because a emplty variable, a non-array, is being used with the count function.

In libraries/jdom edit file jdom.php line 384

Change
else if (($i !== null) && (count($args) > $i))

to
else if ($i !== null)
Just call me Chris :)
Last Edit: 24 Mar 2022 03:10 by organicwebs.
The administrator has disabled public write access.

PHP 8 Compatibitility 24 Mar 2022 03:14 #15931

  • organicwebs
  • organicwebs's Avatar
  • Offline
  • Premium Member
  • Chris
  • Posts: 133
  • Thank you received: 20
  • Karma: 7
Now, after this first hurdle... when you go to create a New item, you'll get the same error. This is another bug in the item controller.

In /public_html/administrator/components/com_yourcomponent/classes/controller/item.php Line 240

Change:
if (!count($cid))

To
if (empty($cid))
Just call me Chris :)
The administrator has disabled public write access.

PHP 8 Compatibitility 30 May 2022 12:55 #15940

  • Romkabouter
  • Romkabouter's Avatar
  • Offline
  • Elite Member
  • Posts: 305
  • Thank you received: 128
  • Karma: 48
Good work :)
The administrator has disabled public write access.
Time to create page: 0.094 seconds

Get Started