Redirect fails in two different ways depending on the SEF setting. When SEF is off, the redirect loses the 'Itemid' parameter, so it goes the the correct page but is lacking all the definitions attached to that menu item. When SEF is on, redirect loses the alias and goes nowhere. Language is right in both cases.
Am I missing something with the multi-language setup?
I did some tracing and I found out that the "magic" happens in languagefilter plugin inside buildRule function. The menu item is being fetched from the menu object, but object doesn't contain that item since user doesn't have access to it.
Code: Select all
if ($item = JFactory::getApplication()->getMenu()->getItem($Itemid))
{
if ($item->home && $uri->getVar('option')!='com_search')
{
$link = $item->link;
$parts = JString::parse_url($link);
if (isset ($parts['query']) && strpos($parts['query'], '&')) {
$parts['query'] = str_replace('&', '&', $parts['query']);
}
parse_str($parts['query'], $vars);
// test if the url contains same vars as in menu link
$test = true;
foreach ($vars as $key=>$value)
{
if ($uri->hasVar($key) && $uri->getVar($key) != $value)
{
$test = false;
break;
}
}
if ($test) {
foreach ($vars as $key=>$value)
{
$uri->delVar($key);
}
$uri->delVar('Itemid');
}
}
}
else
{
$uri->delVar('Itemid');
}