Every time I try to translate a string I get a HTTP status 0 error and I've also found the following in my Firefox logs.

Error: $("#formToL10nServer").attr("action", Drupal.settings.l10n_client_server).attr is not a function
Sourcefile: http://localhost/drupal6/sites/all/modules/l10n_client/l10n_client.js?e
Line: 176

Comments

gábor hojtsy’s picture

Category: bug » support
Status: Active » Closed (fixed)

Looks like user error. You've upgraded the module but did not run update.php so your JavaScript cache was not emptied for regeneration. You site caches an outdated version of the JS of this module.

hass’s picture

Title: "is not a function" errors » Upgrade/cache clear and uninstall code is missing
Category: support » bug
Status: Closed (fixed) » Active

Just a second... if the module does not provide a new update hook I don't need to refresh anything. My status page does not tell me anything I need to regenerate. Only for a test I cleared all my caches now and the problem is gone.

As l10n_client don't have a .install file I expect there is no upgrade path yet. Additonal there is no uninstall code, but variables like "l10n_client_use_server".

gábor hojtsy’s picture

Title: Upgrade/cache clear and uninstall code is missing » Uninstall code is missing

Don't blame this module if you don't read the docs. Even Drupal core release notes includes to run update.php even when there are no update functions to run at all to clear caches, so all new changes take effect. update.php does that when you run it, you just need to follow the docs. There is nothing we should do about that here. No module is adding empty update functions just to trick you into running update.php. You should run it when you update any of your modules.

As for the uninstall code, looking forward to a patch.

hass’s picture

Ups... never done this within the last years... good to know, but not very user friendly.

gábor hojtsy’s picture

It is quite user friendly: always run update.php. It is much less user friendly if you need to look into the .install file code to identify whether there was an update function or not, or even worse, if Drupal needs to inform you after the fact that you missed running update.php.

hass’s picture

I remember that I've read it that I should run update.php very very long time ago, but never seen any difference until today...

However this is OT here - if Drupal knows that there is a newer version installed - it could simply themself clear the caches automatically on the next page request... this would be user friendly solution.

hass’s picture

Aside some people added menu_rebuild() functions in .install files. This seems also be executed by update.php. I could simply remove googleanalytics_update_6003() and ignore all complains in #262468: Can't configure GA without running update.php... I've stolen this in past from dww's update_status.install

gábor hojtsy’s picture

#345918: how do you uninstall Localization client? is now marked as duplicate of this issue.

gábor hojtsy’s picture

Priority: Critical » Normal

The the moment, the following two settings are available:

- l10n_client_server
- l10n_client_use_server

These two would need to be removed on uninstall. Anybody interested in doing a quick .install file with code to remove these on uninstall? :)

dawehner’s picture

Status: Active » Needs review
StatusFileSize
new1.21 KB

here is one.

dawehner’s picture

StatusFileSize
new444 bytes

rerole. Forgot something in the file.

gábor hojtsy’s picture

Version: 6.x-1.6 » 7.x-1.x-dev
Status: Needs review » Patch (to be ported)

Added a little whitespace (two spaces on the comment line in @file) and committed as-is. To be ported to D7.

gábor hojtsy’s picture

dawehner’s picture

Status: Patch (to be ported) » Needs review
StatusFileSize
new360 bytes

I'm confused, i used this syntax for a while, but then people said, its wrong, here is recent example which might be right ;)

http://drupalcode.org/viewvc/drupal/drupal/index.php?revision=1.98&view=...

The patch uses my old code style.

gábor hojtsy’s picture

Status: Needs review » Needs work

@dereine: your patch seems to apply to the D6 version and changes how it works?!

andypost’s picture

Suppose you need cache_clear_all('variables', 'cache'); after this query, not sure that uninstall process cleans variables cache

gábor hojtsy’s picture

@dereine?

SebCorbin’s picture

Status: Needs work » Fixed

Fixed in D7

andypost’s picture

Version: 7.x-1.x-dev » 6.x-2.x-dev
Status: Fixed » Patch (to be ported)

This needs backport, D6 still used wide

SebCorbin’s picture

Status: Patch (to be ported) » Closed (fixed)