CComment and Joomla multilanguage site problems

Troubleshooting and debugging hidden errors

Publicado por José A. Cidre Bardelás o 04-08-2018


Fixing CComment and Joomla multilanguage site problems.

Recently I had to install the CComment extension in a perfectly working Joomla multilanguage web site. Apparently, after the installation all was fine and no problems can’t be observed but, a day later, the site owner informs that the web homepage was always showed in English (and the posterior pages as well) no matter what was the language used or defined as default.


The first analysis showed that the problem only arose after visiting a page with comments in it, therefore it looked as the culprit was CComment. Also, the homepage link wasn’t including any language specification, i.e. the language was obtained form the correspondent language cookie created by Joomla. The problem showed up with SEF enabled and disabled.

One first look at the language cookie manifested that the language changed to en-GB every time we visited a page with CComment displaying its form, with or without comments, and even after publishing a comment without reloading the page. It seemed that some XHR was changing the cookie language.

Monitoring the URL calls with the browser developer tools showed one XHR to:

The problem was here most probably.

Debugging and fixing

The file calling that URL was:

Searching in the code of this file we can see this:

If we change it (deleting the parameter ‘lang=en’) to:
the problem must be solved.

And, in fact, after that, all the tests went right. Then, error fixed.

comments powered by Disqus