If I use this field, I get the following MySQL error:

SELECT files.fid AS fid, nid FROM files files LIMIT 0, 10 in /mounted-storage/home61c/sub001/sc37964-JLVH/test/dru6/sites/all/modules/views/includes/view.inc on line 592.

Sometimes I got the error about wrong syntax near nid IN (,,,,,,,). I can't reproduce this situation now, but I've got it several times.

Comments

dpantele’s picture

Ok, I've reproduced the second situation.
Only select all fields, available for 'files' type while creating a view. You need to have at least one node with uploaded files.

The full error text is

user warning: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ' , , , , , , , 1, 1) ORDER BY u.weight, u.description' at line 1 query: SELECT u.nid, u.fid, f.filepath, u.description FROM upload u LEFT JOIN files f ON f.fid = u.fid WHERE u.nid IN (, , , , , , , , 1, 1) ORDER BY u.weight, u.description in /mounted-storage/home61c/sub001/sc37964-JLVH/test/dru6/sites/all/modules/views/modules/upload.views.inc on line 167.

The query was

SELECT files.fid AS fid,
   files.filemime AS files_filemime,
   files.filename AS files_filename,
   files.filepath AS files_filepath,
   files.filesize AS files_filesize,
   files.status AS files_status,
   files.timestamp AS files_timestamp,
   nid,
   upload.description AS upload_description,
   upload.list AS upload_list,
   upload.weight AS upload_weight
 FROM files files 
 LEFT JOIN upload upload ON files.fid = upload.fid
merlinofchaos’s picture

Status: Active » Fixed

This should be fixed; note that the fix will cause views with these fields to break and act erratically until they're fixed, but they should not be awful breakage.

Anonymous’s picture

Status: Fixed » Closed (fixed)

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