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