Hi, lately I am having this problem with Internet Explorer 8:
The language switcher dropdown locks on one language, so it doesn't allow me to switch to any other language (I can choose one, but nothing happens). I am not sure whether this problem has been there all the time because personally I normally user other browsers. So it might be because of a conflict with another module I have installed lately.
However, I am not having the problem with Google Chrome and Firefox. When I activate the standard language swithcer in IE, it also works fine.
Can you reproduce this? Or do you have any idea what might be the cause?
Comments
Comment #1
lpalgarvio commentedhaving same issue
worse if you don't define paths for some languages.
Comment #2
mohammed j. razemThe bug seams to be with IE7/IE8 not Language switcher dropdown.
See http://www.jeepstone.co.uk/2009/06/10/ie8-html-dropdown-opens-pop-up-blo...
I have the same issue on my IE8 running as Virtual Machine. It's because of bad plugins or conflicting dlls.
Comment #3
LarsKramer commentedThanks for the information. I never used the software described in the link. However, I just reinstalled Language switcher dropdown and ATM I am no longer able to reproduce the error with IE8. Let's hope it stays that way :-)
Comment #4
yannickooThe problem is that
document.location.hrefdoesn't work in IE <= 8. I attached a patch which provides a IE fallback.Comment #5
manfer commentedIt is just much easier to use window.location instead of document.location which solve the issue for older Internet Explorer versions.
Comment #6
manfer commentedPushed to 6.x-1.x development branch. Same problem needs to be solved in 7.x version.
Comment #7
manfer commentedComment #8
manfer commentedPushed to 7.x-1.x development branch.
Comment #9
yannickooSorry manfer but you patch doesn't work. I tested in in Internet Explorer 7 and 8. When I'm using my patch it works. I think it's necessary to create the a element and trigger a click on it.
Comment #10
manfer commentedThis would need further test to find what is failing in your site but as far as I know and as I tested, nor IE8 nor IE7 have any problem with window.location, and though it is safer to use that one, even document.location should work either I think.
I would need a link to try to further investigate what's wrong.
To be totally sure about window.location would be easy to test in your IE8 if it has that object correctly available. Just in your IE8 menu select Tools->Developer tools (shortcut F12) and in the window that popups go to Script tab and at the right in the console type in the textbox:
window.location.href="http://drupal.org"and hit run script. That should redirect to drupal.org.
Similar test can be done with document.location.href.
If those tests does not work in your IE8 or IE7 then I don't know what's wrong.
A link to inspect it would be of help.
Comment #11
yannickooI tested it with a jsbin and both methods work but the language switcher doesn't work with them.
Comment #12
manfer commentedSo if window.location works it is not the problem. The next thing to check would be the values of the options in the select to find if there is something wrong with them that the code does not like. -though a link tag href seems have no problem about those values-. You can check which are those values running the following script in a console:
$('#edit-lang-dropdown-select')[0].options[0].valuefor the first option.
$('#edit-lang-dropdown-select')[0].options[1].valuefor the second option... and so on...
Though I can't see anything wrong on that right part of the assigment:
document.location.href = this.options[this.selectedIndex].value;as all this would be the same value:
you can try anyway to change that line of code to:
window.location.href = $(this).val();to test what happens as that's the syntax you are using to assign the value to the link href attribute.
Other possibility that comes to my mind is if you have some kind of software that blocks javascript redirections like those ones.
Comment #13
yannickooIt's right that
has the same value. I played with window.location, window.location.href, location.href, $(window).attr('location') and it doesn't work on my site. As I tested a jsbin with the same functionality it works. I don't know what is wrong on my site but the only way which works is creating an a element and trigger a click on it.
I think we should rewrite the module so that it also works without javascript. Why not using links which looks like a select list? I saw that the drupal 7 version uses a form with a go button. That's quite a better way but not a select list that only works with javascript.
Is this issue closed (fixed) now? I really would know the reason why it doesn't work...
Comment #14
manfer commentedI would need a link to the site where it does not work to look if I can find the problem.
About making it work without javascript, it already should. When javascript is disable the switcher is no more than a form with a select input and a button. When the button is clicked the form is submitted triggering a POST request to the server that redirects to the new selected language. Both in 7.x and 6.x versions of the module.
Comment #15
yannickooOh, I didn't know that, sorry. Nice idea with the noscript ;)
Comment #16
manfer commented