Every CCK field is available in Views as a regular formatted field and as 'data', listed like this in the UI:
'Content: Foo (field_foo) - data'

If this is a multiple value field, adding it produces multiple rows -- it would be useful to warn the user of this in the UI, say in the field description. Would potentially save head-scratching / hair-puling!

CommentFileSizeAuthor
#7 filefield_data_views_help.patch879 bytesquicksketch
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

joachim’s picture

Project: Content Construction Kit (CCK) » FileField
Version: 6.x-2.x-dev » 6.x-3.1

Actually, it looks like this is only filefields. Reassigning.

quicksketch’s picture

Thanks sounds like it might be a bug in the data retrieval. I've seen this happen when joining on the NID instead of the VID (which is what everything else uses in CCK). There should be a way to prevent that sort of behavior I believe, which would be better than a warning probably. :-)

quicksketch’s picture

Category: bug » feature

Hmm, well upon further inspection it's not a bug in data retrieval at all. Additionally this is completely expected behavior if you do anything with the attached files (such as pulling out MIME type or file size). So a message might be appropriate, but I don't think a big warning is necessary and I can't really find a suitable place to put it otherwise. I'm not sure this will be changed.

walker2238’s picture

Is there a reason why it can't be grouped like other file fields to prevent duplicates?

quicksketch’s picture

Status: Active » Closed (won't fix)

Is there a reason why it can't be grouped like other file fields to prevent duplicates?

You can group them if you like, but Views will group them by NID, not by FID (unless you're building a view of type "File"). I'm marking this won't fix, since it's just the way SQL and Views work.

joachim’s picture

Status: Closed (won't fix) » Active

Views core fields for Taxonomy has this description text:

Taxonomy terms. Note that using this can cause duplicate nodes to appear in views; you must add filters to reduce the result set.

How about something similar here?

quicksketch’s picture

Status: Active » Fixed
FileSize
879 bytes

I applied this patch which gives the "data" field a description similar to taxonomy.

Status: Fixed » Closed (fixed)

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

mitadon’s picture

I had a day of head-scratching with duplicating rows with multiple fields, untill i found the solution - I realized that i've used 2 multiple fields one of which was shown in a table with appropriate settings (show as single line). Another was hidden for using in expression, so i didint pay enough attention to its multiple field settings, what resulted duplicating rows. Actually int's not related with FileField, just double check all multiple fields settings.