Support from Acquia helps fund testing for Drupal Acquia logo

Comments

nagy.balint’s picture

jcisio’s picture

Does it happen with a clean install using the latest version of Scald? I think this is a duplicate of #1706108: Problem with scald_thumbnail field

nagy.balint’s picture

Yes it happens on the dev version of scald.

To reproduce upload an image on the UI, and then check in database the file_managed table, and in the status column, with the latest dev what we get is a 0. Basically this patch fixes that so the images enter this table with value 1 (permanent).

This happens because when scald delegates the upload to drupal (http://drupalcode.org/project/scald.git/blob/refs/heads/7.x-1.x:/modules/providers/scald_image/scald_image.module#l26), the upload happens in this callback: http://api.drupal.org/api/drupal/modules%21file%21file.module/function/file_managed_file_value/7
That will call
http://api.drupal.org/api/drupal/modules%21file%21file.module/function/file_managed_file_save_upload/7
Which calls:
http://api.drupal.org/api/drupal/includes%21file.inc/function/file_save_upload/7
Which sets status to 0, which is temporary.

DeFr’s picture

This patch is wrong: as long as the atom isn't saved, we don't want the file to become permanent. Cleaning it up on cron run is thus quite welcome, pretty much like the file attached to a node that's never saved . (Consider the case of an editor only performing the first step of the form, uploading a large file, and never finishing the atom creation process, which means that the file can't be use anywhere, can't be seen using standard UI, but is still uselessly taking up disk space)

When the atom is created, file field automatically takes care of both setting the status to permanent in http://api.drupal.org/api/drupal/modules!file!file.field.inc/function/fi... and adding the file usage information in http://api.drupal.org/api/drupal/modules!file!file.field.inc/function/fi...

nagy.balint’s picture

Apparently thats not the case as we had this issue happening several times, and we did create the atoms and used them in content, so then a day later we came back and it just deleted all the original images leaving error messages.

So we then need a better solution but for the time being, i applied this patch on my site, since we cannot have images getting lost on production.

jcisio’s picture

Did you test with a clean Drupal install (remove all tables, reinstall Drupal, then Scald). What was constated in #1706108: Problem with scald_thumbnail field is there is a bug between alpha/beta release upgrade, however it is not identified.

DeFr’s picture

Status: Active » Closed (cannot reproduce)

Closing pending additional informations on how to reproduce.

sahaj’s picture

Version: 7.x-1.x-dev » 7.x-1.0
Status: Closed (cannot reproduce) » Active

I'm also getting troubles with 'scald_thumbnail' in the last stable version. Here is the message I'm getting during the install (sorry, it is in French):

FieldException: Tentative de créer une instance d'un champ scald_thumbnail qui n'existe pas ou qui est actuellement inactif. in field_create_instance() (line 474 of /Users/Sahaj/Sites/resonantworlds/modules/field/field.crud.inc).

This is not a clean install. Maybe this can help you.

jcisio’s picture

Status: Active » Closed (cannot reproduce)

This is not at all related to this issue. Could you open a new one, with more detail, how to reproduce?

sahaj’s picture

That's right, I misunderstood it. Here is my new issue: http://drupal.org/node/1970080

gisle’s picture

Version: 7.x-1.0 » 7.x-1.x-dev
Component: Code » User interface
Assigned: nagy.balint » Unassigned
Priority: Major » Normal
Issue summary: View changes
Status: Closed (cannot reproduce) » Needs review
FileSize
623 bytes

This does not happen on a clean install, but it happens on an install where somebody has managed to munge the file system permissions for the upload directory so that the web server is not allowed to write to the atom upload upload directory.

The ScaldAtomController actually checks that this directory is writeable, but it fails to produce a meaningful error message if the check fails.

The attached is an a patch simply makes sure that the user is shown a meaningful message when this happens.

nagy.balint’s picture

This should have been a new issue, where the old one could have been marked as related.

gisle’s picture

Component: User interface » Code
Status: Needs review » Closed (cannot reproduce)

@nagy.balint,
sorry - I've reversed its status back to "Closed".

Status: Closed (cannot reproduce) » Needs work
nagy.balint’s picture

Status: Needs work » Closed (cannot reproduce)