I was having an issue with the dropdown printing the domain twice when using a domain instead of a path prefix and have created a fix (well it worked for me anyway).

eg. http://yourdomain.comhttp://yourdomain.com/home

I found the issue was in lang_dropdown.module
** Problem **

$path = check_url(url($lang_option['href'], array('language' => $lang_option['language'])), array('language' => $lang_option['language'], 'external' => TRUE)));

** Fix **

$path = check_url(url($lang_option['href'], array('language' => $lang_option['language'])));
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

lordofthelake’s picture

Status: Active » Reviewed & tested by the community

+1 it worked for me. Thank you!

MXT’s picture

I had the same issue, and this patch resolve the problem.

Can this be committed in the official release?

Thank you very much.

MXT’s picture

Version: 6.x-1.6 » 6.x-1.7
Priority: Major » Critical
Status: Reviewed & tested by the community » Needs work

I've just upgraded to lang_dropdown 6.x-1.7 and this BUG is still present.

Why the patch above after a whole year hasn't be committed yet?

Now the same patch doesn't work with lang_dropdown 6.x-1.7 (error is the same: domain printed twice)

Someone has some idea to resolve?

manfer’s picture

Version: 6.x-1.7 » 6.x-1.x-dev
Status: Needs work » Needs review
FileSize
914 bytes

The following patch should solve the problem.

Just One Note
----------------------------------
Though drupal has this description for the language domain configuration:

Language-specific URL, with protocol. With language negotiation set to Domain name only, the site is presented in this language when the URL accessing the site references this domain. For the default language, this value may be left blank. This value must include a protocol as part of the string. Example: Specifying "http://example.de" or "http://de.example.com" as language domains for German results in URLs in the forms "http://example.de/node" and "http://de.example.com/node", respectively.

I wouldn't recommend at all to leave the value blank for the default language as that way language switchers won't work correctly -not only language dropdown switcher but core language switcher block too-.

So if you don't have already a domain configured for the default language I suggest going to /admin/settings/language/ and configure the default language. You can use whatever domain you want. So for example if english is the default language depending what we want we could decide to configure domain as: "http://en.example.com", "http://example.com.en", or even just "http://example.com" -not using the language code in the domain name for the default language-. But even in this case using "http://example.com" we have to explicitly configure it in the default language and not setting it blank as the description suggests.

This must be what was trying to solve the old code I have deleted in this patch. It is possible that were correct in older drupal 6 versions not now.
----------------------------------

MXT’s picture

Patch in #4 resolve the problem.

I confirm that my default language was not blank for the language domain configuration.

I hope this patch will be committed soon, thank you very much.

manfer’s picture

Status: Needs review » Fixed

Pushed to dev 6.x-1.x version.

Status: Fixed » Closed (fixed)

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