Install JCE
Enable JCE in Global Config
Edit an article
Ability to edit an article
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 ...
PHP 8+ its broken
With PHP 7.4 it works perfectly.
Labels |
Added:
?
|
Title |
|
Title |
|
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.
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 :).
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... ;)
@ryandemmer Yes, an easy fix for you and I'm sure you won't complain about it :).
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.
or Joomla could call $this->_editor->onDisplay(...$args)
which would not cause a PHP 8 named arguments issue
or Joomla could call
$this->_editor->onDisplay(...$args)
which would not cause a PHP 8 named arguments issue
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.
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!
Please close
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: ? |
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.
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.