I wasn't able to select nodes using EntityFieldQuery when I only knew the file ID of the original file, like so:

$query->entityCondition('entity_type', 'node')
    ->entityCondition('bundle', 'photo')
    ->propertyCondition('status', NODE_PUBLISHED)
    ->fieldCondition('field_photo_file', 'fid', $file->fid);

We need this because we are using the file ID in the URL. Imagefield_crop creates a new file each time a node was saved, so the URL became invalid. I created a patch that adds orig_fid attribute to the field, so you can use this in a condition:
fieldCondition('field_photo_file', 'orig_fid', $file->fid);

I thought it could be useful to others.

CommentFileSizeAuthor
imagefield_crop_orig_fid.patch2.76 KBbceyssens
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

bceyssens’s picture

Issue summary: View changes
bceyssens’s picture

Issue summary: View changes
ram4nd’s picture

Status: Active » Needs review