Joomla dispatcher.php and event.php Fix Errors

There are a few plugins that aren’t compatible with PHP 5.3+ and Joomla 1.5x, and they may show up like the error messages below:

PHP Warning: Parameter 2 to plgContentEmailCloak() expected to be a reference, value given in /libraries/joomla/event/dispatcher.php on line 136


PHP Warning: Parameter 2 to plgContentLoadModule() expected to be a reference, value given in /libraries/joomla/event/dispatcher.php on line 136
PHP Warning: Parameter 2 to plgContentPagebreak() expected to be a reference, value given in /libraries/joomla/event/dispatcher.php on line 136

PHP Warning: Parameter 2 to plgContentJA_highslide::onPrepareContent() expected to be a reference, value given in /libraries/joomla/event/event.php on line 67
PHP Warning: Parameter 2 to plgContentJA_tabs::onPrepareContent() expected to be a reference, value given in /libraries/joomla/event/event.php on line 67

Fortunately, this is a pretty simple thing to fix; look for line 136 in dispatcher.php and line 67 in event.php and add this one single line;

$args

[1]   = & $args[1];

So your final code (for dispatcher.php) will look like this:

if (function_exists($observer[‘handler’]))
{
   $args[1]   = & $args[1];
   $result[] = call_user_func_array($observer[‘handler’], $args);
}

and for event.php:

if (method_exists($this, $event)) {
  $args[1] = & $args[1];
  return call_user_func_array ( array($this, $event), $args );
} else {

Alternatively, you can download the fix here. This is tested working on Joomla 1.5.23+. Hope this helps!

By | 2017-03-14T17:31:48+00:00 May 18th, 2012|Support Articles|4 Comments

About the Author:

A Leading Technology Company that offers Web & IT Services in the Fraser Valley - Mission, Abbotsford, and Langley.

4 Comments

  1. santiago October 9, 2012 at 10:13 pm - Reply

    Genius Thank you for posting this!

  2. steve January 6, 2013 at 4:19 pm - Reply

    Thanks a million – this solved my problem!

  3. Errors after upgrading PHP to 5.4 in Joomla dispatcher.php and event.php - Technology February 20, 2015 at 10:46 am - Reply
  4. Errors after upgrading PHP to 5.4 in Joomla 1.5.25 dispatcher.php and event.php | DL-UAT March 4, 2015 at 3:15 am - Reply

    […] I’ve tried solution from this website: http://www.codingconcepts.net/joomla-dispatcher-php-and-event-php-fix-errors […]

Leave A Comment