The only two settings I've made is to select the image as a field and use mimetype as a filter. This builds the following SQL statement and error:

user warning: Unknown column 'type' in 'field list' query: SELECT files.fid AS fid, node_data_field_image.field_image_fid AS node_data_field_image_field_image_fid, node_data_field_image.field_image_list AS node_data_field_image_field_image_list, node_data_field_image.field_image_data AS node_data_field_image_field_image_data, nid, type, vid FROM files files LEFT JOIN content_field_image node_data_field_image ON files.fid = node_data_field_image.field_image_fid WHERE (files.filemime) LIKE ('image%') LIMIT 0, 10 in /opt/lampp/htdocs/sites/all/modules/views/includes/view.inc on line 771.

Fields nid and vid are available in content_field_image, but not the field type.

Comments

merlinofchaos’s picture

Project: Views (for Drupal 7) » ImageField
Version: 6.x-2.10 » 6.x-3.3
Component: Miscellaneous » Code

This looks like CCK's handler adding its fields so it knows the node type but a 'files' view won't have a node type. Ultimately this is probably imagefield's issue since making its fields available to the files table is probably something special that it does. (Maybe it's filefield?)

greygoo’s picture

I'm getting the same error here with imagefield-6.x-3.3 with Views 6.x-2.10 on Drupal 6.16

quicksketch’s picture

Project: ImageField » FileField

Yeah I think this is actually caused by CCK, not FileField or ImageField. CCK provides FileField's basic Views handling, and in this case I believe it's trying to get the node type, which isn't available as merlinofchaos noted. A couple of work-arounds:

- Start out with a Node View instead of a File View, then make your FileField relationship over to the Files table as you would normally.
- Add a relationship to the Node when staring with a File View (I'm not sure this actually supported).

mariafromatoz’s picture

I got a similar error message when building a view formatted as a table. My chosen fields (CCK text field - select list) appear on the table ok but when I click on their titles - which are sortable - the error occurs. I just upgraded to Views 6.x-3.0-alpha3.

greygoo’s picture

I'm getting the same error here with imagefield-6.x-3.3 with Views 6.x-2.10 on Drupal 6.16

quicksketch’s picture

As noted in #3, you can prevent this problem simply by starting with a "Node" view instead of a "File" view.

It's still a bug in our implementation somewhere, but the work-around is simple enough to prevent this problem.

greygoo’s picture

Could you elaborate on "Start out with a Node View instead of a File View, then make your FileField relationship over to the Files table as you would normally."?

How do you make your FileField relationship over to the Files table?

quicksketch’s picture

When creating a new view, use the default "Node" type. Then once building the View, add a relationship for "Content: [Field name]" for the FileField. Then you can add "File: Filename" or any other File fields to the view.

quicksketch’s picture

Status: Active » Postponed (maintainer needs more info)

I haven't been able to actually reproduce this issue in any way (starting with either a node view or a file view). Please provide steps to reproduce.

jurgenhaas’s picture

Can't reproduce it either and as it was reported against FileFiled 3.3 it may have gone away already.

quicksketch’s picture

Status: Postponed (maintainer needs more info) » Closed (cannot reproduce)

Closing after lack of activity and ability to reproduce.

radman16’s picture

Status: Closed (cannot reproduce) » Closed (fixed)

Changed the status because I was able to reproduce this error. It occurred when using the latest version of filefield with an older version of Views and CCK. Updating all to the latest versions corrected the problem.