This article shows you how to fix this error.
If you are interested, you can also see the entire thread of discussions started by lightningbit here.
Once you have done (A) and (B), your googleSearch should be able to work with sh404SEF.
Explanation of the Bug
If you're interested, here's an explanation of the bug - how and why it occurs.
- The bug seems to occur in only Joomla 1.5 and above.
- If you're familiar with Google Adsense Search, your Google Adsense ID is passed to Google with the URL parameter client.
- Internally in Joomla 1.5, there is also a "client identifier" with the value 0, 1, 2 or 3. If you're interested, you can get a more detailed explanation about this client identifier in the file:
libraries/joomla/application/helper.php, class JApplicationHelper, function &getClientInfo().
- If you take a look at the original function in
administrator/components/com_sh404sef/sh404sef.class.php to retrieve the client identifier as highlighted above:
function shGetFrontEndActiveLanguages() {
$shLangs = array();
// Initialize some variables
$client =& JApplicationHelper::getClientInfo(JRequest::getVar('client', '0', '', 'int'));
The first parameter is the parameter name 'client'. The second is the default value, which is '0'. The third is '', which in this case refers to $_REQUEST. The last is the data type, which is 'int'.
Because of the third parameter '' which refers to $_REQUEST, if you've specified your Google Adsense ID, the highlighted line above will read your Google Adsense ID and returned it as the client identifier. Note: this is the main reason why the error disappears if you did not specify your Google Adsense ID.
The last parameter 'int' will force your Google Sense ID (e.g. pub-1234567812345678 which is an alphanumeric value) to be converted to an integer, which usually results in a large negative integer value. However, in Joomla, the client identifier can only have the value 0, 1, 2 or 3.
As a result of the above, JApplicationHelper::getClientInfo() doesn't return a valid ClientInfo class.
And the following line
$path = JLanguage::getLanguagePath($client->path);
causes the infamous error
JFolder::folder: Path is not a folder: /language
To fix the error, I used another Joomla function to retrieve the client identifier
JFactory::getApplication()->getClientId()
with a valid client identifier, I can proceed to retrieve a valid ClientInfo class:
$client =& JApplicationHelper::getClientInfo(JFactory::getApplication()->getClientId());
Of course, we'll only do this if we're running googleSearch. Hence the conditional statement:
if (JRequest::getVar('option', '')=='com_googlesearch') {
So the complete solution is as follows:
function shGetFrontEndActiveLanguages() {
$shLangs = array();
// Initialize some variables
if (preg_match('/com_googlesearch/', JRequest::getVar('option', ''))) {) {
$client =& JApplicationHelper::getClientInfo(JFactory::getApplication()->getClientId());
} else {
$client =& JApplicationHelper::getClientInfo(JRequest::getVar('client', '0', '', 'int'));
}