Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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.
Comment | File | Size | Author |
---|---|---|---|
#10 | 1213218-views-file-image-field-relationships.patch | 5.65 KB | Dave Reid |
#9 | 1213218-views-file-image-field-relationships.patch | 5.65 KB | Dave Reid |
#7 | 1213218-file-uid-relationship.patch | 1015 bytes | dawehner |
#5 | 1213218-file-uid-relationship.patch | 364 bytes | dawehner |
Comments
Comment #1
Dave ReidThe 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.
Comment #2
Dave ReidOk so I've narrowed it down to it's specifically a problem with the file entity fields, and not just revisionable vs non-revisionable.
Comment #3
dawehnerYeah, views needs a 'default_relationship' for the join between files and users as welll.
Comment #4
Dave ReidWell 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.
Comment #5
dawehnerCan you please try out this patch?
Clear the views cache to make it working.
Comment #6
Dave ReidActually, 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. :)
Comment #7
dawehnerCan you please try out whether this still work?
Even if it's fixed in the dev version there is a underlying problem here.
Comment #8
Dave ReidClarified: 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.
Comment #9
Dave ReidComment #10
Dave ReidFixed remaining copy/paste error from file.views.inc to image.views.inc.
Comment #11
dawehnerThanks for writing this integration!!!
Commited both patches to 7.x-3.x