At line 115 you have

  db_query('INSERT into {files} (fid, nid, filename, filepath, filemime, filesize)  
             VALUES (%d, %d, "%s","%s","%s",%d)',
            $file['fid'], $node->nid, $file['filename'], $file['filepath'], $file['filemime'], $file['filesize']);

which unfortunately creates an error in postgresql because it expects single quotes around strings (as does mysql but it is a little more tollerant in this case, see http://mysql.com/doc/refman/5.0/en/string-syntax.html ).
I suggest changing the line to

  db_query("INSERT into {files} (fid, nid, filename, filepath, filemime, filesize)  
             VALUES (%d, %d, '%s','%s','%s',%d)",
            $file['fid'], $node->nid, $file['filename'], $file['filepath'], $file['filemime'], $file['filesize']);

as that code will work in both.

Thanks,
Steven

CommentFileSizeAuthor
#1 imagefield.module_2.patch1.01 KBhavran

Comments

havran’s picture

Version: 6.x-3.x-dev » 4.7.x-1.x-dev
Assigned: Unassigned » havran
Priority: Normal » Critical
Status: Active » Reviewed & tested by the community
StatusFileSize
new1.01 KB

This bug is in booth (4.7 and cvs) versions too... Patch for 4.7 is attached (maybe work for cvs too).

drewish’s picture

dopry’s picture

applies to HEAD and DRUPAL-4-7, tnx.

dopry’s picture

Status: Reviewed & tested by the community » Fixed

umm yeah s/applies/applied && status=fixed.

Anonymous’s picture

Status: Fixed » Closed (fixed)