create a content plugin that triggers onContentAfterSave
My plugin works fine in backend (any Joomla or PHP version)
In the frontend it works fine with PHP 7.0.x. It breaks and shows error message with PHP 7.1 and above
No error
Too few arguments to function PlgSystemFields::onContentAfterSave(), 2 passed in /home/.../public_html/libraries/joomla/event/event.php on line 70 and at least 3 expected
Call stack
1 () JROOT/plugins/system/fields/fields.php:43
2 PlgSystemFields->onContentAfterSave() JROOT/libraries/joomla/event/event.php:70
3 JEvent->update() JROOT/libraries/joomla/event/dispatcher.php:160
4 JEventDispatcher->trigger() JROOT/components/com_gsimporter/models/logform.php:350
Joomla 3.7, 3.8 and 3.9 - error irrespective to Joomla version
PHP 7.0.x no error
PHP 7.1 and above with error
original Joomla code is:
JROOT/libraries/joomla/event/event.php:70 => return call_user_func_array(array($this, $event), $args);
I suggest to add an argument to eliminate error - this solves the issue:
return call_user_func_array(array($this, $event), $args, 0);
oops sorry
Status | New | ⇒ | Discussion |
Labels |
Added:
J3 Issue
|
Can't reproduce this on core.
Looks like com_gsimporter
passes only 2 arguments but it should be at least 3 in 3.x. See documentation https://docs.joomla.org/Plugin/Events/Content#onContentAfterSave.
Status | Discussion | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2019-05-19 16:03:00 |
Closed_By | ⇒ | franz-wohlkoenig |
closed as stated above.
https://issues.joomla.org/tracker/joomla-cms/23395 Can you test this?
This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/23396.