3

I have a Joomla website and I had to upgrade webhosting to PHP 5.4.

Now I see these errors on my website:

Warning: Parameter 1 to plgContentMultiAds::onPrepareContent() expected to be a reference, value given in /www/doc/www.myweb.cz/www/libraries/joomla/event/event.php on line 68

Warning: Parameter 1 to plgContentEmailCloak() expected to be a reference, value given in /www/doc/www.myweb.cz/www/libraries/joomla/event/dispatcher.php on line 137

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

But it doesn't work.

The "problematic line" looks like this:

$result[] = call_user_func_array($observer['handler'], $args);

or

return call_user_func_array ( array($this, $event), $args );

I've tried to find the solution on the internet, but no luck.

Than there is another error:

Warning: Creating default object from empty value in /www/doc/www.myweb.cz/www/modules/mod_latestnews/helper.php on line 109

Line 109:

$lists[$i]->link = JRoute::_(ContentHelperRoute::getArticleRoute($row->slug, $row->catslug, $row->sectionid));

Thanks for help!

  • 1
    You may want to consider starting to migrate your site to Joomla 3.x as 1.5 is no longer supported. – Lodder Mar 4 '15 at 9:21
2

Given that those seem to be simply warnings about lack of compatibility with the installed PHP version which you can't really fix and that your Joomla! version is obsolete, that is you have chosen not to go through the trouble of migrating it, it should be safe and acceptable to simply turn off error reporting.

This is usually not advisable, but in your case having error reporting enabled gives no real benefit as your site is what it is.

You can also suppress errors on specific lines by adding @ in front of the offending statement. This is acceptable when you know what causes the error and there is no real benefit in fixing it. But the performance is worse than simply turning off error reporting.

This of course assumes the site works despite the warnings. Usually this is the case, but...

EDIT: George Wilson has a good point about Joomla! 1.5 not being PHP 5.4 supported. If your site works other than that one module, the easiest solution might be to replace that particular module. Although getting 1.5 extensions is getting more difficult and there would be no guarantee it would work either. (Many 1.5 extensions were not updated for 5.4, after all.)

Alternatively you can check with your host about the possibility of using alternate PHP version, precisely because of issues like this many hosts allow choosing PHP version from .htaccess. But that depends entirely on the provider.

  • Thank you. Turning off error reporting in configuration didn't help. What helped was adding @ in front of the offending statement, but the affected module doesn't work. But there is one line, where I don't know where to add @: $lists[$i]->link = JRoute::_(ContentHelperRoute::getArticleRoute($row->slug, $row->catslug, $row->sectionid)); Don't you please know? – Pavel Mar 5 '15 at 16:08
  • @Pavel Not really, it has to be added to the offending expression, and from the error it seems like one of the articles lacks some data? So @ might not make it work correctly. The sad part is that I remember running to this exact problem and fixing it but have no recollection of how... Maybe it was about an article having a category or section that had been removed and thus returns null slug? You could check the articles for that I suppose? But as said I don't really remember, sorry. – Ville Niemi Mar 5 '15 at 21:47
  • OK, thank you very much. I guess I will have to upgrade my Joomla, it's necesary anyway. – Pavel Mar 6 '15 at 23:32
2

Joomla 1.5 isn't PHP 5.4 compatible as per the Joomla Documentation https://docs.joomla.org/Joomla_1.5_won%27t_work_on_PHP_5.4

Note that there are core hacks available on the internet to get you said support. But really you should look to upgrade to Joomla 3.x as soon as physically possible

-1

Adding an @ before the line as following solved the problem for me:

@$lists[$i]->link = JRoute::_(ContentHelperRoute::getArticleRoute($row->slug, $row->catslug, $row->sectionid));
  • 2
    This is only silent error reporting. That's not a solution in any situation. – Alexandr Nov 18 '17 at 19:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.