“Fatal error: Call to undefined method stdClass::render()” when Using JComments

One of our clients was getting the following error after upgrading Joomla from 3.3.6 to 3.4:

Fatal error: Call to undefined method stdClass::render() in /components/com_jcomments/libraries/joomlatune/template.php on line 318

He told us that immediately after he upgraded to Joomla 3.4, JComments (the famous Joomla commenting platform), stopped working (clicking on the Add Comments link stopped working). So, what our client did is that he uninstalled and then re-installed JComments – but when he did that, he got the above error, and so he called us!

Luckily, the above error told us clearly where the problem was. So, we opened the file template.php located under the /components/com_jcomments/libraries/joomlatune/ folder, and we jumped to line 318, and here’s what we saw:

$this->_templates[$template]->render();

Hmmm… So the template cannot be rendered, but why? So, we went to the JComments settings in the backend, by clicking on Components -> JComments -> Settings, and then clicking on the Layout. We then quickly checked the Template field (in the View section) and we immediately noticed that no template was assigned. Naturally, our first instinct was to assign a template to the Template field, and so we did that (we chose the default template) and we checked the website, and guess what, the problem was no more!

So, what did cause the problem in the first place?

The problem was caused by the fact that our client was using a custom template that did not exist in JComments public distribution, and so when he uninstalled JComments, that template was removed. The new installation of JComments used the old settings, and so it set the Template field to the non-existing template – hence the problem.

If you’re seeing the same problem on your Joomla website and if you are using JComments, then most likely the problem is that there is no template assigned in your JComments settings. If you already have a template assigned, then make sure that all the files pertaining to that template exist. If you are also sure about that, then your best option would be to contact us. We will fix the problem for you in as little time as possible and for a very affordable fee!

No comments yet.

Leave a comment