J4.x

Actionlogs issue with php7.2

From Joomla! Documentation

Revision as of 06:44, 1 February 2023 by MartijnM (talk | contribs) (Marked this version for translation)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Other languages:
English • ‎Nederlands

Due to a trailing comma in administrator/components/com_actionlogs/src/Dispatcher/Dispatcher.php Line 39 sites with PHP 7.2 are experiencing an error in actionlogs "syntax error, unexpected ')'".

This does not effect the upgrade functionality when using actionlog.

Errors reported[edit]

The error has been reported in the forum https://forum.joomla.org/viewtopic.php?f=9&t=999478

Versions affected[edit]

General Information

This pertains only to Joomla! version(s): 4.2.7 running on PHP 7.2

What is the cause[edit]

The cause is that PHP 7.2 does not allow trailing commas in its function calls.

How to fix[edit]

Trailing-comma.png

The workaround is to update the file administrator/components/com_actionlogs/src/Dispatcher/Dispatcher.php Line 39 and remove the comma as shown in the screenshot. Alternatively if you can upgrade your sites PHP version to a version higher than 7.2 then this would also fix the issue without needing to change the code. It is adviced to use a version of PHP greater than 7 i.e. 8.0 or 8.1 as 7 version of PHP is unsupported by PHP.