Active
Project:
Imagefield Crop
Version:
7.x-2.0
Component:
Code
Priority:
Major
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
19 Jul 2014 at 00:58 UTC
Updated:
23 Jul 2014 at 04:17 UTC
Jump to comment: Most recent
The content of the imagefield_crop field is being deleted when saving an entity after upgrading to Drupal 7.29.
This core regression bug was created for the Taxonomy module and seemed related, but does not address contrib modules. :(
To reproduce this bug:
The new call to file_download_access($file->uri) (line 515 of file.module as of Drupal 7.29) seems to have triggered this issue.
Comments
Comment #1
citricguy commentedComment #2
citricguy commentedThis issue is resolved by adding a call to hook_file_download().
The below code likely has issues, but it does work for me.
I added it to the bottom imagefield_crop.module
There are a few additional details here if anyone wants to dig in.
Comment #3
David_Rothstein commentedJust to follow up here, it looks like only the 7.x-2.x branch of the module has this problem (because 7.x-1.x doesn't define its own field)?
I was able to reproduce it using 7.x-2.0, but the core patches from comment #42 onward in #2305017: Regression: Files or images attached to certain core and non-core entities are lost when the entity is edited and saved seem to take care of fixing it, so I think this might get fixed in core.
However, code similar to the above would make sense for this module to add anyway, since otherwise there will be problems on sites that use private files (regardless of Drupal 7.29 or not); for example, problems with end users not being able to view images associated with Image Cropped fields on those sites even when they are supposed to.