I see this was reported and fixed in 5.x, but I'm now having this problem with i18n 6.x-1.0-beta1 and activemenu 6.x-1.x-dev (datestamp 1208995217).

CommentFileSizeAuthor
#6 activemenu.module.254277.patch741 bytesmvc

Comments

antiorario’s picture

I think it's a conflict with locale.module. I disabled all i18n modules and the problem persists, but only if I choose "Path prefix with language fallback" under /admin/settings/language/configure. Choosing "Path prefix only" apparently doesn't affect Active Menus.

antiorario’s picture

Ok I'll correct myself. Active Menus does not work if a language prefix is present in the URL. I hope I'll have some time in the next few days to try to understand the issue better.

Dofer’s picture

Not sure that it will be the best or even right fix. But it works for me :)

function activemenu_get_request_path(){
	global $language;
	$lang = '';
	if(module_exists('locale'))
	{
		$ln_negotiation =  variable_get('language_negotiation', 0);
		$lang_list = language_list();
		if($ln_negotiation == 1 || $ln_negotiation == 2)
		{
			$lang = substr($_POST['path'], 0, strpos($_POST['path'], '/'));
			if(isset($lang_list[$lang]))
			{
				$language = $lang_list[$lang];
			}
			
			if(isset($_POST['path']))
			{
				$_POST['path'] = substr($_POST['path'], strpos($_POST['path'], '/')+1);    
			}
		}
	}
	return isset($_POST['path']) ? drupal_get_normal_path($_POST['path'], $lang) : FALSE;
}
Eleazan’s picture

#3 it works for me... thnx!

I have edited the .js for use with locale, but it only works with the 'default' language, and now works for all :) (need undo my changes in the js).

Note: do you need to have a "language path", else, doesn't work with these language.

Sorry, my English is so bad.

Dofer’s picture

Noticed that my previous fix worked only if language was sent in url

function activemenu_get_request_path(){
	global $language;
	$lang = '';
	if(module_exists('locale') && isset($_POST['path']))
	{
		$_GET['q'] = $_POST['path'];
		$language = language_initialize() ;
		$_POST['path'] = $_GET['q'];

		$lang = ($language != language_default()) ? $language->language : '';
	}
	return isset($_POST['path']) ? drupal_get_normal_path($_POST['path'], $lang) : FALSE;
}
mvc’s picture

Status: Active » Needs review
StatusFileSize
new741 bytes

Dofer's patch works for me using language switching via path prefix. I've attached a patch file with that change in case anyone wants it. Since I haven't personally tested this using language switching via domain, I'll leave this issue as "patch (code needs review)" for now.

nedjo’s picture

Status: Needs review » Fixed

Applied, thanks Dofer and mvc.

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.