Postponed (maintainer needs more info)
Project:
File Entity (fieldable files)
Version:
7.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
7 Aug 2012 at 08:59 UTC
Updated:
8 Dec 2016 at 18:59 UTC
Jump to comment: Most recent
Comments
Comment #1
dddave commented1. Additional finding
Reusing images already used by the site elsewhere seems to avoid deletion upon language change. Images seem to be "harder" to delete anyways: Need to change the language two times to lose them.
Info: Using a site with German as default and English as second language.
Comment #2
dddave commentedSetting to postponed until I find out which set up exactly creates this mess. Might take some time due to i18n being involved.
Comment #3
dave reidI would also test this with just Drupal core and without Media, because likely the problem stems from core's file usage handling.
Comment #4
dddave commentedYeah, this might take some while. Have this on different installs with very different modules.
Comment #5
dddave commentedOk, I did try to recreate this on pretty vanilla installs but failed so far. The installs which show this are fairly convoluted so that this may be caused by whatnot modules. I am going to bring a new project into production pretty soon which features a multilingual set up but is constructed more carefully. I hope I won't see this issue again but leave this issue postponed for the time being.
Comment #6
alanom commentedResearching a similar issue, I thought I'd share what I found:
field_attach_update()can cause D7 file field files to be deleted, if less than the whole entity is passed tofield_attach_update()- see #1483736: field_attach_update deletes file fields (content & file) In entity regardless of if they are included in the entity object.. Some sources in the past have suggested passing incomplete entity objects tofield_attach_update()to cut out unneccesaryentity_load()s, it's possible that some of the convulted code in those projects uses this method.Comment #7
dddave commentedCurrently I have lost all ennergy to hunt this down. Unless this comes up in one of my projects I won't dig further into it. Currently my guess is that this happens because of i18n+entity translation. I use this set-up on a couple of projects currently and so far haven't had the issue but neither of these projects is a convoluted as the one metioned in my OP.
Comment #8
steinmb commentedStumbled upon this issue. Even if we changed a lot in our translation system do we have this unresolved critical core issue #2810355: $entity->isDefaultTranslation() behaves incorrectly when changing default translation, causing file/image field usage to be set to zero, causing files to be deleted
Comment #9
joseph.olstadMight want to also check the file_entity issue queue to see if this issue is already mentioned in there . I suspect this is more related to file_entity than it is media 7.x-2.x as file_entity was taken out of media 7.x-2.x , unless someone intended this to be a 7.x-1.x issue?
Comment #10
steinmb commentedI'll move it file entity. It anyway need to be addressed by core, but I think we should keep the issue around just in case any changes to core there req. media/file_entity to change to utilize the changes.