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

Wappie08’s picture

Very 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

Jose Reyero’s picture

Category: bug » support
Priority: Critical » Normal
Status: Active » Fixed

There were issues with field's languages in both Drupal core and i18n that have been fixed in latest versions

Wappie08’s picture

Priority: Normal » Major
Status: Fixed » Active

Do 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

Wappie08’s picture

Priority: Major » Critical

Hi 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

Jose Reyero’s picture

Priority: Critical » Normal
Status: Active » Closed (cannot reproduce)

As 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.

Wappie08’s picture

Thanks 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:

UPDATE `yourdatabasename`.`field_data_field_image` SET `language` = 'und' WHERE `field_data_field_image`.`entity_type` = 'node'

When you get SQL duplicate entry errors you can try to remove some double values (same node with different languages).


Greetings Wappie

gagarine’s picture

Status: Closed (cannot reproduce) » Active

We should add the fix in #6 in an hook_update.

webflo’s picture

As 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.

Jose Reyero’s picture

Status: Active » Closed (won't fix)

Feel free to reopen posting a patch that handles all these possible cases.

plach’s picture

plach’s picture

Issue summary: View changes

changed d.o. link to right format

steinmb’s picture