Menu item created
An error has occurred.
0 Too few arguments to function PlgContentJoomla::onContentBeforeSave(), 3 passed in D:\www\joomla4\libraries\src\Plugin\CMSPlugin.php on line 287 and exactly 4 expected
Joomla 4 nightly build
This can be easily fixed by modifying code on this line https://github.com/joomla/joomla-cms/blob/staging/administrator/components/com_menus/models/item.php#L1430 and add $data variable to the event trigger. However, there would be many other places which we need to check and also, it would cause same errors with third party extension. So maybe we can make $data parameter optional in this method onContentBeforeSave https://github.com/joomla/joomla-cms/blob/4.0-dev/plugins/content/joomla/joomla.php#L55
Labels |
Added:
?
|
I like better your second solution, something like
public function onContentBeforeSave($context, $table, $isNew, $data = '')
Labels |
Added:
J4 Issue
|
I have encountered issue on 21st Dec nightly build. As of now, I am using the workaround suggested above public function onContentBeforeSave($context, $table, $isNew, $data = '').
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2018-12-30 16:25:40 |
Closed_By | ⇒ | joomdonation |
@joomdonation
I use a J!4 where 23355 is already merged. So, I see no reason to close my PR at the moment.
OK. Just for information, you can see @wilsonge comment about it at #23293 (comment) ($data is required, not optional as proposed in your PR)
I confirm the issue, not only create but also saving an existing menu item.