Trying to see if this is reproducable, but if you have a field that is used on both a revisionable (node) and non-revisionable (say, user or comment) entity, then creating a user or comment view, we are unable to select that field in the field list or use it as a relationship.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Dave Reid’s picture

The error that's brought me to this conclusion so far has been "Notice: Undefined index: file in field_views_field_default_views_data() (line 222 of /shared/vash/sandboxes/reid/marketplace/www/sites/default/modules/views/modules/field.views.inc)." when using the file_entity module in Media module, which enables fieldable file entities.

Dave Reid’s picture

Title: Error in field_views_field_default_views_data() when a field is attached to both revisionable and non-revisionable entities » Error in field_views_field_default_views_data() when using file_entity.module

Ok so I've narrowed it down to it's specifically a problem with the file entity fields, and not just revisionable vs non-revisionable.

dawehner’s picture

Yeah, views needs a 'default_relationship' for the join between files and users as welll.

Dave Reid’s picture

Well we can even get the error when trying to create a file view - we can't select any fields attached to the file entity to be added to the view - it has something to do with the PHP notice though according to my debugging.

dawehner’s picture

Status: Active » Needs review
FileSize
364 bytes

Can you please try out this patch?

Clear the views cache to make it working.

Dave Reid’s picture

Status: Needs review » Fixed

Actually, now that we updated to Views 7.x-1.x-dev, the notices went away and we could add fields associated with files to the view either in a node, file, or user context. Looks like this just works now. Thank you dereine for checking. :)

dawehner’s picture

Title: Error in field_views_field_default_views_data() when using file_entity.module » Add a explicit relationship from file to user.
Status: Fixed » Needs review
FileSize
1015 bytes

Can you please try out whether this still work?
Even if it's fixed in the dev version there is a underlying problem here.

Dave Reid’s picture

Title: Add a explicit relationship from file to user. » Not able to use file fields in relationship
Status: Needs review » Active

Clarified: we are not able to create a relationship with File fields from Node or User views, unlike other fields which are listed in the 'Add relationship' modal.

Dave Reid’s picture

Title: Not able to use file fields in relationship » Not able to use file or image fields as a relationship
Category: bug » feature
Status: Active » Needs review
FileSize
5.65 KB
Dave Reid’s picture

Fixed remaining copy/paste error from file.views.inc to image.views.inc.

dawehner’s picture

Status: Needs review » Fixed

Thanks for writing this integration!!!

Commited both patches to 7.x-3.x

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.