Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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'])));
Comment | File | Size | Author |
---|---|---|---|
#4 | lang_dropdown-duplicate_domain_in_url-1192136-4.patch | 914 bytes | manfer |
Comments
Comment #1
lordofthelake CreditAttribution: lordofthelake commented+1 it worked for me. Thank you!
Comment #2
MXTI had the same issue, and this patch resolve the problem.
Can this be committed in the official release?
Thank you very much.
Comment #3
MXTI'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?
Comment #4
manfer CreditAttribution: manfer commentedThe following patch should solve the problem.
Just One Note
----------------------------------
Though drupal has this description for the language domain configuration:
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.
----------------------------------
Comment #5
MXTPatch 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.
Comment #6
manfer CreditAttribution: manfer commentedPushed to dev 6.x-1.x version.