Hello, I just lost all images of a few nodes by simply changing the language of a node and hitting save.. I think this has something to do with i18n as I cannot reproduce this on a clean d7 install.
Errors:
After saving a node in a different language the images are no longer displayed. When editing the node again, the following error is shown:
Warning: array_merge() [function.array-merge]: Argument #2 is not an array in file_field_widget_form() (line 463 of /drupal7/modules/file/file.field.inc).
I could only find #1171760: warning: array_merge() [function.array-merge]: Argument #2 is not an array when using CCK 3.x for this error but that seems another problem.
To temporary prevent the images from getting deleted I made my files directory non-writable, this resulted in the following error (for every image):
Warning: unlink(/drupal7/sites/default/files/styles/somestyle/public/someimage.jpg) [function.unlink]: Permission denied in drupal_unlink() (line 2151 of /drupal7/includes/file.inc).
If anybody knows how to do some good debugging on this, please let me know!
Greets Wappie
Comments
Comment #1
Wappie08 CreditAttribution: Wappie08 commentedVery weird: I just installed a clean d7 + i18n and cannot reproduce this error.. does anybody hava an idea what could be the issue?
I have tried disabling all contrib modules in the problematic install but no module (exept i18n) seems to do stuff with multi-language..
Greetings Wappie
Comment #2
Jose Reyero CreditAttribution: Jose Reyero commentedThere were issues with field's languages in both Drupal core and i18n that have been fixed in latest versions
Comment #3
Wappie08 CreditAttribution: Wappie08 commentedDo you mean latest devs? I'm currently running latest drupal 7.x (updated 5 mins ago) and i18n 1.0 (21 aug, same date as latest dev) and still experiencing this bug! Kind of a critical bug for my live sites :P
This is a site made in d7 (no upgrade).
Can you please specify any related threads so I can investigate?
Greets Wappie
Comment #4
Wappie08 CreditAttribution: Wappie08 commentedHi Jose Reyero, please provide any related threads (as I did not find them) and - if you know - please give me some hints on how to debug this problem! I'm stuck with this nasty bug on a live site..
Greetings Wappie
Comment #5
Jose Reyero CreditAttribution: Jose Reyero commentedAs you say in #1 this is not happening with a clean install. So it must be something related to how data was stored with previous versions. Both Drupal core and i18n have fixed some issues related to field's language handling.
So:
1. Find out what is different with the field/language storage for existing nodes and new nodes and fix that.
2. We cannot help with this as it will possibly depend on which versions (core, i18n) you used to create your content with and your specific upgrade path.
Comment #6
Wappie08 CreditAttribution: Wappie08 commentedThanks Jose! I found out how to make a fix for anyone interested:
- look up the image fields inside your db in the "field_config" table and put the "translatable" value to 0.
- then go to the db table for your specific field(s) and set all the field languages to "und", use this sql query for example:
When you get SQL duplicate entry errors you can try to remove some double values (same node with different languages).
Greetings Wappie
Comment #7
gagarine CreditAttribution: gagarine commentedWe should add the fix in #6 in an hook_update.
Comment #8
webflo CreditAttribution: webflo commentedAs in #5 it is very hard to reproduce and there are many possible ways. This could also happen if you switch from field (aka Entity translation) to Node translation.
Comment #9
Jose Reyero CreditAttribution: Jose Reyero commentedFeel free to reopen posting a patch that handles all these possible cases.
Comment #10
plachThis is probably a core issue: #1141912: Changing node language by moving down language list deletes files in file field.
Comment #10.0
plachchanged d.o. link to right format
Comment #11
steinmb CreditAttribution: steinmb as a volunteer commented