onContentBeforeDisplay
plugin event without a fallback variable for the $page
parameter. Like this:public function onContentBeforeDisplay($context, &$row, &$params, $page) {
}
You can also temporary remove the = 0
after the $page
for a existing plugin. For example the vote plugin on this line: https://github.com/joomla/joomla-cms/blob/staging/plugins/content/vote/vote.php#L62
2. Set the error reporting to maximum
3. Go to the media manager and notice the following error:
Too few arguments to function PlgContentVote::onContentBeforeDisplay(), 3 passed in /usr/local/apache2/htdocs/libraries/joomla/event/event.php on line 70 and exactly 4 expected
No errors or warning
Too few arguments to function PlgContentVote::onContentBeforeDisplay(), 3 passed in /usr/local/apache2/htdocs/libraries/joomla/event/event.php on line 70 and exactly 4 expected
PHP 7.1.7
Latest Joomla! staging
The issue also appear in a older PHP version (PHP7.x). But it seems like that the latest php version raises a error with higher priority than previous versions.
The error is caused by multiple event dipatchers in the administrator/components/com_media/views/medialist/tmpl
folder that call the onContentBeforeDisplay
event without the the fourth argument, $page
. A solution might be adding a 0
as fourth parameter. However I'm not sure if this is the right solution.
Labels |
Added:
?
|
I created a PR for this. I think that fixing for 3rd party extensions is very hard. We cannot change the event dispatcher specific for this event.
The default value is indeed exact for this situation :-)
Category | ⇒ | com_media |
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2017-07-19 04:36:46 |
Closed_By | ⇒ | franz-wohlkoenig |
Closed_By | franz-wohlkoenig | ⇒ | joomla-cms-bot |
Set to "closed" on behalf of @franz-wohlkoenig by The JTracker Application at issues.joomla.org/joomla-cms/17129
closed as having PR #17133
hmm IMO we could just fix that in the core but any 3rd party that is triggering this event will throw that error too. This is what the default value is for. ;) For sure you can add the default (0) to the calling events where not done yet. But this would not fix the 3rd Party triggerd events.