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 worning for onpreparecontent() for event.php on line 67

PHP worning for plgContentLoadModule() or plgContentEmailCloak() or plgContentPagebreak() for dispatcher.php on line 136

example like :

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

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

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 {

Hope this helps!

Advertisements

One thought on “Joomla dispatcher.php and event.php Fix Errors

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

w

Connecting to %s