Closed (fixed)
Project:
FileField
Version:
6.x-3.3
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
20 May 2010 at 18:08 UTC
Updated:
15 Aug 2011 at 02:14 UTC
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
Comment #1
merlinofchaos commentedThis 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?)
Comment #2
greygoo commentedI'm getting the same error here with imagefield-6.x-3.3 with Views 6.x-2.10 on Drupal 6.16
Comment #3
quicksketchYeah 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).
Comment #4
mariafromatoz commentedI 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.
Comment #5
greygoo commentedI'm getting the same error here with imagefield-6.x-3.3 with Views 6.x-2.10 on Drupal 6.16
Comment #6
quicksketchAs 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.
Comment #7
greygoo commentedCould 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?
Comment #8
quicksketchWhen 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.
Comment #9
quicksketchI 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.
Comment #10
jurgenhaasCan't reproduce it either and as it was reported against FileFiled 3.3 it may have gone away already.
Comment #11
quicksketchClosing after lack of activity and ability to reproduce.
Comment #12
radman16 commentedChanged 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.