Probably out of scope for this module, but we have the need to link to a specific revision of a file in file_usage.

Comments

reubenavery’s picture

Title: file_usage should link to specific file revision » field_revision___ tables should link to specific file revision

It's field_revision___ and field_data___ tables that need the revision_id column.

reubenavery’s picture

Title: field_revision___ tables should link to specific file revision » File and Image fields should reference a file by revision_id instead of fid.

..or maybe both.

OK, getting in way over my head here but bravely I will plow along.

There's a related ticket in entityreference: #1837650: Allow referencing a specific revision ID

ericduran’s picture

I'm not sure I understand why they need to reference a revision_id?

The primary revision will be loaded either way. We don't really want to allow reference to non primary revision of a file entity mainly because that makes it overly complicated. Also its a bit of an edge case.

reubenavery’s picture

Yeah, it's a huge edge case. ;-) and it's making me a head case.

It's important for us however, because of the field data attached to an an image that is used in multiple articles. For each article, the image may have a different caption, for example. My plan was to allow overriding of the file entity's primary revision by creating a shadow revision and linking that with the node's image field.

reubenavery’s picture

Status: Active » Closed (works as designed)

Closing this. I'll pursue in a custom module and if I'm successful will share as a sandbox.