Closed (fixed)
Project:
Webform Localization
Version:
7.x-4.x-dev
Component:
Code
Priority:
Critical
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
15 Mar 2012 at 16:20 UTC
Updated:
3 Nov 2015 at 18:04 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
rv0 commentedComment #2
GDrupal commentedThat is strange I will look into it too....
Comment #3
rv0 commentedAaargh spent too many time debugging this simple bug :(
fetchAllAssoc('cid');
Means not a lot will survive the string refresh ;)
Change to:
Comment #4
GDrupal commented@rv0: Ouch that was ugly! I will review this ASAP. Is working properly for you after that change?
Comment #5
rv0 commentedyes, working fine here..
The only strange issue I have is that a new node with same fields (using a slightly modified version of webform_template to handle the localization settings) will use the string translation of the original node (which it shouldn't without any custom code). After refreshing strings however, it doesn't have this behavior. Weird cashing issue? I'm not too familiar with i18nstrings yet.
Comment #6
GDrupal commentedThat is strange indeed because the string are found by a string id that uses the node id... nid+cid+stuff... have to be unique right?
Comment #7
rv0 commented@GDrupal, indeed.. and when I check the translation table there's only the strings of the original node.
Anyway, this problem should fix itself in my use case as I'm writing code to copy and resave the original strings, but with the new nid in the name string.
Comment #8
GDrupal commentedFixed, committed and attributed!
Comment #10
mlima commentedI'm having the exact same issue in the exact same scenario.
Comment #11
bluesman2014 commentedMe too, hundreds of translated strings have been deleted!
Comment #12
bluesman2014 commentedComment #13
alanburke commentedData Loss means this is critical
Comment #14
denes.szabo commentedSame issue. I have just lost all my translated string during refresh.
Comment #15
denes.szabo commentedMy quick fix for my site:
Delete 237-240 lines from webform_localization_delete_all_strings() function webform_localization/includes/webform_localization.i18n.inc.
Now, my translations remain intact after strings refresh.
Comment #16
tascSame here, but fortunately I have a Feature which reverts my translations, so I can reproduce.
With "clean up left over strings checked" it happens only on batch when I select multiple text groups. In my case these are Fields, Metatag, Webform Localization, Menu, Taxonomy in this order.
Selecting Fields alone deletes all translations for Fields.
Selecting Metatag, Webform Localization, Menu, Taxonomy deletes Webform Translations.
Selecting Webform Localization, Menu, Taxonomy the translations get refreshed & stay intact.
Bizarre..
(#15 doesn't work)
Comment #17
denes.szabo commented@tsc_a - You are right, #15 is not a good solution. Actually, somehow I could manage to delete my translations. But, I removed the delete part of this module… So, It's correct: bizarre.
Comment #18
denes.szabo commentedI just did a little debug:
The refresh strings deletes the strings when the Node types and Webform Localization both selected from text groups.
If both selected, the translate elements version become 0 (locales_source.version) , then because of the "Clean up left over strings" is set, these translate elements will be removed completely - so you can't translate them again, just after refresh the Webform strings, because the sources have deleted.
I am continue now with the "Node types" debug…
Comment #19
karlkablisk2 commentedArg! I just had this issue and was so confused. I see the change mentioned above in the module file
$components = $query->execute()->fetchAll();
To Denes.Szabo. Your tip was a BIG help in isolating the issue so it can be avoided.
But I still had ONLY my webforms translations deleted when Node types strings were refreshed. I didn't have both selected and I didn't have "Clean up left over strings." checked. I did a few tests because I was lucky enough to have a backup with backup and migrate module to do this a few times.
So I can now avoid all my form translations being deleted... My problem now is that the new webform translations won't appear because when I refresh the strings on webform localization, nothing happens. Also I think this bug should be addressed. If I slip up once and don't have a backup handy I will have to redo all the translations.
Side note does drupal have any direct translation options!? This is annoying refreshing strings etc. Why can't there be a 1:1 translation right next to the field when I edit it. This is the most counter intuitive system I've seen in Drupal, language isn't being handled well at all. I didn't see much better with what little I messed with 8 so far. Until then this string refresh system, if I have to rely on it, needs to at least work.
Help! anyone! >_<
Comment #20
joseph.olstadComment #21
rv0 commentedThe fix is quite simple I think, we have to check if $group == 'webform' in the refresh callback.
See attached patch that does that (patch looks big, but thats just because all the code is nested in the 1 line check. I havent changed any other logic)
My strings don't got lost any more using the usecase from #18
Comment #22
joseph.olstadHi rv0, thanks for the patch, is it correct to assume that you tested this on todays build of 4.x before and after the patch and that after the patch on the latest 4.x the behavior is corrected?
Comment #23
rv0 commented@joseph.oldstad.
The patch was created from the latest 4.x branch from git which is at commit 17fb10d303f28f7a517013f7265a253795e3af5e (yesterdays commit)
That is the normal way to create patches afaik ;)
If you are unsure about your version, you can do this fix manually:
- find webform_localization_i18n_string_refresh
- change the function header to
function webform_localization_i18n_string_refresh($group) {- place all the code in the function in the following condition
if ($group == 'webform') { /* code goes here */ }Comment #25
joseph.olstadComment #26
joseph.olstadThanks RV0, nice work!