?
avatar stAn47
stAn47
6 Mar 2015

Steps to reproduce the issue

  1. Enable SEO
  2. Multi language site set up
  3. use URL like this to check the proper functionality of the language:
    index.php?option=com_ajax&module=virtuemart_bohcatfilter&format=raw&nosef=1&lang=fr&ict=36

  4. we are using:
    \modules\mod_virtuemart_bohcatfilter\helper.php

class modVirtuemartBohcatfilterHelper {
 public static function getAjax() {
   $lang = JFactory::getLanguage();
   $language_tag = $lang->getTag();
   var_dump($language_tag); die(); 
 }
}
  1. you can see that the language_tag was IMPROPERLY SET to joomla's default language regarless of the configuration of the language filter plugin and the current value of the language cookie

  2. FIX:

we found that altering line:

274: else
to
274: if (empty($lang_code))

fixes the problem.

More lines:

.... 
// We have found our language and the first part of our URL is the language prefix
                if ($found)
                {
                    array_shift($parts);
                    $uri->setPath(implode('/', $parts));
                }
            }
        }
        if (empty($lang_code))
        {
            // We are not in SEF mode
            $lang = $uri->getVar('lang');

            if (isset($this->sefs[$lang]))
            {
                // We found our language
                $found = true;
                $lang_code = $this->sefs[$lang]->lang_code;
            }
        }

in \plugins\system\languagefilter\languagefilter.php

JOOMLA 3.4.0

Furthermore the plugin SHOULD NOT DO A REDIRECT from within an Ajax context because it can easily redirect the user to the Ajax page for some old Chrome, Firefox or IE browsers. In short, there must not be any redirects from within the ajax context.

Before doing any redirect there can be a check done:

$doc = JFactory::getDocument(); 
$class = class_name($doc); 
$class = strtoupper($class); 
if ($class === 'JDOCUMENTHTML') ... 

Expected result

  1. redirect to /default-lang/rest of the path...
  2. wrong language detected from the URL

Ideal result:
1. No redirect to SEF from ajax context
2. Proper language detection

Actual result

System information (as much as possible)

Additional comments

avatar stAn47 stAn47 - open - 6 Mar 2015
avatar stAn47 stAn47 - change - 6 Mar 2015
The description was changed
avatar zero-24 zero-24 - change - 6 Mar 2015
Category Multilanguage Plugins
avatar brianteeman brianteeman - change - 7 Mar 2015
Labels Added: ?
avatar brianteeman
brianteeman - comment - 7 Mar 2015
avatar infograf768
infograf768 - comment - 9 Mar 2015

Please test again after applying both these patches:

#6278
and
#6254


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/6336.
avatar brianteeman brianteeman - change - 12 Mar 2015
Status New Information Required
avatar brianteeman
brianteeman - comment - 13 Mar 2015

Set to information required.

@stAn47 Please can you comment if the fixes linked to by @infograf768 work for you or if this is still an issue after applying those fixes


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/6336.
avatar Explorepartners
Explorepartners - comment - 13 Mar 2015

It is a serious problem so I would like to test can you send me the files so I can upload them with ftp sorry Im not a programmer


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/6336.
avatar brianteeman
brianteeman - comment - 14 Mar 2015

The easiest way to to test is to install com_patchtester and then use that to apply the two patches @infograf768 suggested

You can download com_patchtester from here https://docs.joomla.org/Component_Patchtester_for_Testers


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/6336.
avatar brianteeman brianteeman - close - 14 Mar 2015
avatar brianteeman brianteeman - change - 14 Mar 2015
Status Information Required Closed
Closed_Date 0000-00-00 00:00:00 2015-03-14 10:36:11
Closed_By brianteeman
avatar brianteeman brianteeman - change - 14 Mar 2015
Closed_Date 2015-03-14 10:36:11 2015-03-14 10:36:12
avatar brianteeman brianteeman - close - 14 Mar 2015
avatar Explorepartners
Explorepartners - comment - 14 Mar 2015

Hi
That is a nice feature but when fetch data the:
#6278
and
#6254
are not pulled :(

is there a new combined one?

Add a Comment

Login with GitHub to post a comment