No Code Attached Yet
avatar PhilETaylor
PhilETaylor
3 May 2021

Steps to reproduce the issue

Install JCE
Enable JCE in Global Config
Edit an article

Expected result

Ability to edit an article

Actual result

PHP 8 has named parameters!!! This I believe is a Joomla PHP 8 issue and not one to blame JCE for!

Note that the error and stack trace point to a Joomla set of files and not JCE - so please DONT close this or write it off as a JCE issue without debugging!!! If it effects JCE, its probably going to effect other editors ...

Screenshot 2021-05-04 at 00 18 21

System information (as much as possible)

PHP 8+ its broken

With PHP 7.4 it works perfectly.

Screenshot 2021-05-04 at 00 30 24

Additional comments

@ryandemmer @widgetfactory

avatar PhilETaylor PhilETaylor - open - 3 May 2021
avatar joomla-cms-bot joomla-cms-bot - change - 3 May 2021
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - labeled - 3 May 2021
avatar PhilETaylor PhilETaylor - change - 3 May 2021
The description was changed
avatar PhilETaylor PhilETaylor - edited - 3 May 2021
avatar PhilETaylor PhilETaylor - change - 3 May 2021
Title
[4] Cannot edit content with 3rd party editor
[4] PHP 8 Issue - Cannot edit content with 3rd party editor
avatar PhilETaylor PhilETaylor - edited - 3 May 2021
avatar PhilETaylor PhilETaylor - change - 3 May 2021
The description was changed
avatar PhilETaylor PhilETaylor - edited - 3 May 2021
avatar PhilETaylor PhilETaylor - change - 3 May 2021
Title
[4] PHP 8 Issue - Cannot edit content with 3rd party editor
[4] PHP 8 named parameters issue - Cannot edit content with 3rd party editor
avatar PhilETaylor PhilETaylor - edited - 3 May 2021
avatar ryandemmer
ryandemmer - comment - 4 May 2021

Thanks @PhilETaylor

I've just run a little test where I clear the contents of all methods in the plugins/editors/jce.php file, and disabled all other JCE plugins, and the above error still occurs.

This is obviously not caused by any process within JCE.

avatar PhilETaylor
PhilETaylor - comment - 4 May 2021

It kinda is and kinda is not a JCE issue. But its one that Joomla should fix too.

It will only happen on PHP 8 due to the name arguments feature and the way Joomla calls the JCE method with call_user_func

its because JCE is missing the $params from its method - but equally Joomla should be able to cope with that.

avatar joomdonation
joomdonation - comment - 4 May 2021

If JCE has $params parameter in onDisplay method, the error would not happen. The code in Joomla has been there for sometime, so we could also that it is something JCE should fix to be compatible with PHP 8 :).

avatar ryandemmer
ryandemmer - comment - 4 May 2021

Oh I see! An easy fix for me then.

I blame it on the fact that yesterday was a bank holiday here, so today is basically a Monday... ;)

avatar joomdonation
joomdonation - comment - 4 May 2021

@ryandemmer Yes, an easy fix for you and I'm sure you won't complain about it :).

avatar ryandemmer
ryandemmer - comment - 4 May 2021

If JCE has $params parameter in onDisplay method, the error would not happen. The code in Joomla has been there for sometime, so we could also that it is something JCE should fix to be compatible with PHP 8 :).

Yeah you are right. Fixed in the next update.

avatar PhilETaylor
PhilETaylor - comment - 4 May 2021

or Joomla could call $this->_editor->onDisplay(...$args) which would not cause a PHP 8 named arguments issue

avatar ryandemmer
ryandemmer - comment - 4 May 2021

or Joomla could call $this->_editor->onDisplay(...$args) which would not cause a PHP 8 named arguments issue

😂

avatar ssnobben
ssnobben - comment - 5 May 2021

Should be fixed now for JCE Pro 2.9.7 Beta 7 updated.
Changelog Beta 7 Fixed
-Attempting to load the editor in Joomla 4 with PHP 8 would produce an error.
-Setting a comma seperated mediatype value, eg: mediatype="jpg,jpeg" for a custom Media - JCE field would produce an invalid mediatype list.


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/33529.
avatar PhilETaylor
PhilETaylor - comment - 26 Sep 2021

same thing different place #35675

avatar alexandreelise
alexandreelise - comment - 26 Sep 2021

Thanks @PhilETaylor for helping Joomla! being PHP8.0 compliant. When I see that PHP8.1 should come out in november and we need to do that again. Hopefully it won't break that much since it's a minor version PHP8.1. Take care you all Super Joomlers!

avatar dgrammatiko
dgrammatiko - comment - 9 Nov 2021

Please close

avatar PhilETaylor PhilETaylor - change - 13 Nov 2021
Status New Closed
Closed_Date 0000-00-00 00:00:00 2021-11-13 12:05:18
Closed_By PhilETaylor
Labels Added: No Code Attached Yet
Removed: ?
avatar PhilETaylor PhilETaylor - close - 13 Nov 2021
avatar PhilETaylor
PhilETaylor - comment - 13 Nov 2021

Please close

The "more correct" fix is to modernise the code to ensure that it takes into account PHP 8 features, including Named Parameters, although there seems little appetite for that in the Joomla code base.

We should stop telling 3pd to fix their stuff - again, and implement a more bullet proof solution in Joomla which is simple to remove calls to call_user_func* functions or, pass those functions a non-keyed array by using the array_values() fix to strip the keys.

See also #35675

But once again Joomla doesnt care about modernising the codebase and prefers to get 3pd to work around the limitations.

Add a Comment

Login with GitHub to post a comment