I am using a custom template, and when I enable a certain module, I get the following error:

Catchable fatal error: Object of class stdClass could not be converted to string in 
/home/my_host_username/public_html/libraries/cms/module/helper.php on line 202

Any ideas on how to fix this?

1 Answer 1


This is one funny problem.
It seems that Joomla includes code from module template overrides in a manner that certain variable names do affect the core JModuleHelper renderModule function.

All you need to do to reproduce this bug-like behavior, is to write the following line in your module template override:

$template = JFactory::getApplication()->getTemplate(true);

By loading any object in a variable called $template, you break your site.

So, the problem has a simple solution. Namely:
Search the module template override code (inside templates/your_template/html/mod_modulename)
or possibly even in the module itself (inside modules/mod_modulename), for $template and replace with anything else, like $a_template or $my_template and this will be fixed.

Make sure to let the developer know, if this is not something written by you.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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