? ? Failure

User tests: Successful: Unsuccessful:

avatar n9iels
n9iels
14 Jul 2017

Pull Request for Issue #17129

Summary of Changes

This PR adds a fourth argument to the dispatcher for the onContentBeforeDisplay and onContentAfterDisplay events. Without this argument the following error might occur if there is no fallback for this argument:

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

Testing Instructions

  1. Create 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
  1. Apply the patch and confirm the error is solved
avatar n9iels n9iels - open - 14 Jul 2017
avatar n9iels n9iels - change - 14 Jul 2017
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 14 Jul 2017
Category Administration com_media Templates (admin) Front End Templates (site)
avatar franz-wohlkoenig franz-wohlkoenig - change - 5 Nov 2017
Status Pending Needs Review
avatar franz-wohlkoenig
franz-wohlkoenig - comment - 5 Nov 2017

Status is set on "Needs Review".

avatar mbabker
mbabker - comment - 21 Jul 2018

Seriously, this is rather simple...

avatar franz-wohlkoenig franz-wohlkoenig - change - 21 Jul 2018
Status Needs Review Discussion
avatar Quy Quy - test_item - 22 Jul 2018 - Tested successfully
avatar Quy
Quy - comment - 22 Jul 2018

I have tested this item successfully on 614e122

Code review since the repo is no longer available.


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/17133.

avatar alikon
alikon - comment - 10 May 2019

another task for @HLeithner

avatar alikon
alikon - comment - 11 May 2019

i was able to reproduce the error hacking the vote plugin as for test info
after apply pr the error is solved

avatar alikon
alikon - comment - 11 May 2019

I have tested this item successfully on 614e122


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/17133.

avatar alikon alikon - test_item - 11 May 2019 - Tested successfully
avatar alikon alikon - change - 11 May 2019
Status Discussion Ready to Commit
Labels
avatar alikon
alikon - comment - 11 May 2019

RTC


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/17133.

avatar HLeithner HLeithner - change - 12 May 2019
Status Ready to Commit Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2019-05-12 06:59:20
Closed_By HLeithner
Labels Added: ?
Removed: J3 Issue
avatar HLeithner HLeithner - close - 12 May 2019
avatar HLeithner HLeithner - merge - 12 May 2019
avatar HLeithner
HLeithner - comment - 12 May 2019

Thx

Add a Comment

Login with GitHub to post a comment