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.
Hi community,
I've just instaled Localization Client module 5.x-1.0 in a 5.7 Drupal version.
When I push "Translate Text" button nothing happens.
Debuging it with Firebugs I get a "$.cookie is not a function" error in l10n_client.js (line 46)
Any idea about what's wrong?
Thanks
Comment | File | Size | Author |
---|---|---|---|
#32 | l10n_client-fixed.zip | 3.67 KB | thejalal |
Comments
Comment #1
drupallfm CreditAttribution: drupallfm commentedSame problem with me, using 6.x-1.3.
I click in the "Translate Text" and no pop-up window....
Comment #2
drupallfm CreditAttribution: drupallfm commentedTryed with Firefox and worked! seem to be a ie7 problem or configuration, can anybody help with this issue?
Comment #3
azuledu CreditAttribution: azuledu commentedI've tried with Firefox 3, with IE7, with Drupal 5.7 and with Drupal 6.2 ........ and it never works.
Comment #4
-Anti- CreditAttribution: -Anti- commented> Debuging it with Firebugs I get a "$.cookie is not a function" error in l10n_client.js (line 46)
I get that error too, although it is line 89. It doesn't work in Opera either. I don't have IE7, only IE6 - the blue bar at the bottom of the website doesn't even appear on IE6, but I suppose that is to be expected.
I'm using 6.x-1.3 with Drupal 6.3.
Does this module use /misc/jquery.form.js? I replaced that file with a newer version due to a browser bug which the old version has with the core upload system. That's the only thing I've done to my installation that is unusual in any way.
Cheers.
Comment #5
azuledu CreditAttribution: azuledu commentedFinally I've found the problem.
As localization client module works perfectly installed locally, I suppose that there was a problem with my hosting provider. I talked with them and they found the problem. They use the ModSecurity application, and a firewall rule was blocking the module.
Maybe it works for you. Try it in local and, if it works, maybe the problem is on your hosting provider.
Good luck!
Comment #6
-Anti- CreditAttribution: -Anti- commentedI don't think my host uses mod_security.
You're supposed to be able to disable it from htaccess with this:
But that doesn't work either on my server.
Glad you got it working though.
Cheers.
Comment #7
seutje CreditAttribution: seutje commentedwow, I finally fixed this problem on my drupal 5.10 install :x
way I did it was using this verison of the mod: http://svn3.cvsdude.com/devseed/sandbox/l10n_client_backport/
in conjunction with http://drupal.org/project/jquery_update (which requires u to copy a bunch of shit in the main drupal /misc/ dir)
then it still wouldn't load up the jquery.cookie.js
so I just copied it to the root dir and manually added it to my page.tpl.php
this causes it to always be loaded, even when ppl aren't logged in or anything, but I can live with this, especially since it's not even that big or anything
I'm so happy this works now, took me like a full day :x
Comment #8
vlad.leo CreditAttribution: vlad.leo commentedPlease check version of module 6.x-1.3 or 5.x-1.0 very big diff?
Check your software.
Comment #9
-Anti- CreditAttribution: -Anti- commentedI thought I'd try this module again, but have the same problem with D6.5 and l10n_client-6.x-1.5
I see the 'translate text' bar at the bottom of the website, but it doesn't expand.
I'm using Firefox
1.033.3 (sorry, my mistake) on Windows 2000.Any ideas??
Comment #10
seutje CreditAttribution: seutje commenteduse firebug and see if all the .js files are loading properly and/or if ur getting any errors in the console
also, try using an updated browser instead of some stone-age thingy ;)
Comment #11
azuledu CreditAttribution: azuledu commentedI'm not mean mod_security, I mean "ModSecurity application", an application independent of Apache that some ISP use.
Comment #12
-Anti- CreditAttribution: -Anti- commentedThe only error I get is this:
Error: $.cookie is not a function
Source File: http://domain.net/sites/all/modules/l10n_client/l10n_client.js
Line: 89
which is: switch($.cookie('Drupal_l10n_client')) {
... although I do get a hundred or so javascript 'warnings' in the FF developer
plugin console, from scripts such as lightbox.js, drupal.js, jquery.js, extlink.js and
jquery.hotkeys.js (l10n client). Is that normal?
I do not know javascript, or anything about cookies.
How do I find out if all the javascript is loaded?
I don't have the slightest clue how to go about troubleshooting this error.
EDIT: Using Opera error console, I get a message:
Linked script not loaded -
http://domain.net/sites/all/modules/l10n_client/jquery.cookie.js
Firefox/firebug did not tell me this script was not loading.
So what do you think the problem is?
I've installed this module several times, so it's not a corrupt file.
Any ideas would be appreciated as trying to create a bi-lingual site using
the core's 'translate interface' is really difficult.
Cheers.
Comment #13
seutje CreditAttribution: seutje commentedfirebug probably did tell u, just gotta look in the right place, e.g. the "NET" tab
I've noticed my host doesn't allow any files with .cookie in them, for security reasons, which imo is BS, but that to the side, this is how I fixed it
in my page.tpl.php, I replaced
print $scripts;
with
print str_replace("jquery.cookie.js", "jquery_cookie.js", $scripts);
and I renamed jquery.cookie.js to jquery_cookie.js in the l10n_client folder
ofc this isn't an ideal situation, and u'll have to redo the renaming every time u update the module, but it's worth a shot
Comment #14
Gábor HojtsyWhy is that nobody reported this naming bug yet on http://plugins.jquery.com/project/issues/Cookie?categories=bug ?
Comment #15
seutje CreditAttribution: seutje commentedI didn't report it there, but I've been looking for other ppl that have a host that does weird stuff like that, and haven't found any1 else
and when I asked my host why they did it, they couldn't answer me, they said "it's just safer"
even after googling for hours for any exploitable things that include ".cookie", I couldn't come up with anything...
talked about it with the guru's at #jquery, and they told me not to report it, since it's not a bug in the jquery plugin, but more a bug in webhost policy
posted it in the issue list here a while ago: http://drupal.org/node/306889#comment-1011306
Comment #16
-Anti- CreditAttribution: -Anti- commentedseutje,
Thank you! Your fix in #13 worked perfectly.
EDIT: I had to add this fix to my admin theme too, otherwise I got the error again and things like the Views2 admin interface stopped working.
Do you want me to ask my host why they don't allow the .cookie filename?
Maybe they know why it is blocked.
Cheers!
Comment #17
seutje CreditAttribution: seutje commentedI wouldn't rly call it a fix, it's more like a workaround :x
but yeah, please ask them, maybe they can make it sound logical to me
Comment #18
sepla CreditAttribution: sepla commentedSame Javascript error was driving me mad when I deployed the application on my client's server.
File names containing .cookie has been ignored by the server due to existence of that dead mod_security Apache module.
Comment #19
Gábor HojtsyThe .cookie problem mentioned here several times is duplicate of #306889: Fails to load jquery.cookie.js (hosting problem).
Comment #20
bcpoland CreditAttribution: bcpoland commentedI am having no luck getting the "Translate Text" area to pop up at all using Drupal 6.16. I've tried IE 7 PC, FF3.6 (Mac&PC), Safari4 (Mac&PC), Chrome5 (Mac&PC), as well as switching themes.
I modified htaccess as per #6 as tried the mod in #13, both didn't fix it. Firebug shows that the file "jquery.cookie.js" loaded in the browser, so I don't think its the cookie problem.
What other steps should I take to track down the issue?
UPDATE: I discovered it was a conflict between Localization client and Image Assist.
Comment #21
Zarevac CreditAttribution: Zarevac commentedSame problem, and I agree with bcpoland, after disabling Image Assist the problem disspeared.
Comment #22
Gábor HojtsyIt would be great if you could help us and identify the ways l10n_client and image assist collide. I'm not using these in conjunction, so no experience.
Comment #23
seutje CreditAttribution: seutje commentedI solved my problem with imagefield_assist and l10n_client by adding "edit-target" to the exclude textareas list of imagefield_assist
I imagine image_assist to work the same way (as imagefield_assist code was based on that), so the same workaround should apply
Comment #24
Anonymous (not verified) CreditAttribution: Anonymous commentedI'm trying to use this module. Whenever I click "save translation" it jumps to /i18nstrings/save, with a WSOD white screen.
Comment #25
Anonymous (not verified) CreditAttribution: Anonymous commentedIm using the latest devx.
Comment #26
seutje CreditAttribution: seutje commented@morningtime: it probably throws a JS error right before it does the page load, which would stop execution of that function and cause the submit event to not be prevented. Can you please check this (e.g. press "save translation" and right after that, hit the escape button) and paste the error it's throwing?
Comment #27
nhck CreditAttribution: nhck commentedI haven't gotten it working in any of the browsers - nor do I get an javascript error. The funny thing is that it works when I use ctrl+shift+s
Comment #28
holydrupal CreditAttribution: holydrupal commentedNot working with Drupal 6.19 too.
Nothing will be done by pressing the button, tested with FF 3.6 and IE 8
Comment #29
askibinski CreditAttribution: askibinski commentedSame thing here. No JS errors, no popup when clicking the bar but it does slide out when you click ctrl+shift+s.
Probably a conflict with another module somewhere down the line though..
Comment #30
stefd CreditAttribution: stefd commentedI had the same issue in D7, and can confirm that in my case it is caused by the jquery.cookie.js script being blocked by my server (you can check for you own server by visiting yoursite.com/misc/jquery.cookie.js).
I took inspiration from #13 above, and renamed the file to jquery_cookie.js (note underscore). I then had to change two files where the .js was used: /modules/system/system.module and /sites/all/modules/l10n_client/l10n_client.module.
Hardly a longterm solution, but it works and I don't know how to propose a more definitive fix (being new to D7). I will see if my hosting provider can relax the MODSecurity rule which is the cause of all the trouble...
Comment #31
Gábor HojtsyThe jquery.cookie.js issue for core is at #522646: jquery.cookie.js incompatible with Apache mod_security by default and has tips on fixing mod_security.
Comment #32
thejalal CreditAttribution: thejalal commentedI have the same issue:
$.cookie is unknown function in l10n_client.js
I'm not using mod_security, so it is not that. The problem is solved by making the jQuery.cookie function part of the Drupal.behaviors object. I'm not sure this is the 'correct' way to go about it, but it works for me and doesn't require renaming files and such.
I've attached the modified files.
Comment #33
JohnForsythe CreditAttribution: JohnForsythe commentedhad the same issue. no mod_security. the browser definitely downloads the js ok (the contents of the file are visible in firebug), but $.cookie never gets defined.
thejalal's solution worked for me.
Comment #34
Gábor HojtsyDrupal 6 is not supported. The same problem was not reported for Drupal 7 for some time, despite some initial reports of Drupal 7 problems above.