In the filed image properties, if I set it to upload images in private folder, images are viewable only by his owner, administrators can't view them even if they could.

(Anyway, great module! I hope in a stable release soon!!!)

Issue fork multifield-2217045

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Dave Reid’s picture

Title: Image field issue » Private files always result in access denied
Version: 7.x-1.0-unstable9 » 7.x-1.x-dev
Assigned: Unassigned » Dave Reid
Priority: Normal » Major

Confirmed the bug. Looks like we're going to need to copy what file_file_download() does for anything inside a multifield.

Dave Reid’s picture

BTW I added a 'Known issues' on https://drupal.org/project/multifield for this issue.

slayne40’s picture

Hy,

To define access to private files, Drupal uses the "file_download" function and "hook_file_download"...
And more precisely "file_file_download" function.
No information is returned if the field is "multifield" type.

Create the "multifield_file_download" so that it returns the correct values.

MustangGB made their first commit to this issue’s fork.

MustangGB’s picture

Status: Active » Needs review

There are many different way of writing this.

Here is a version that tries to keep it as close to the original as possible, whilst supporting both files and images.

It's worth noting that multifield_get_file_references() returns the multifield's parents references rather than the subfield's parent references (i.e. the multifield). For example a subfield in a multifield in a node will return a list of nodes rather than a list of multifields.