user warning: query: SELECT n.title, n.nid FROM webform w LEFT JOIN node n ON w.nid = n.nid WHERE w.block = 1 AND n.type IN (0) in /xxxx/www/sites/all/modules/webform/webform.module on line 1385.

The query should be:
SELECT n.title, n.nid FROM webform w LEFT JOIN node n ON w.nid = n.nid WHERE w.block = 1 AND n.type IN ('0')

The code is:

    $placeholders = db_placeholders($webform_node_types);
    $result = db_query("SELECT n.title, n.nid FROM {webform} w LEFT JOIN {node} n ON w.nid = n.nid WHERE w.block = 1 AND n.type IN ($placeholders)", $webform_node_types);

How to escape these placeholders with single quotes?

CommentFileSizeAuthor
#1 webform-postgresql-1003228.txt925 byteserik.erskine

Comments

erik.erskine’s picture

Status: Needs work » Needs review
StatusFileSize
new925 bytes

The query should be this:

SELECT n.title, n.nid FROM webform w LEFT JOIN node n ON w.nid = n.nid WHERE w.block = 1 AND n.type IN ('webform')

The call to db_placeholders is wrong. That should be:

$placeholders = db_placeholders($webform_node_types, 'varchar');
quicksketch’s picture

Title: PostgreSQL fix » PostgreSQL fix to db_placeholders()
Status: Needs review » Fixed

Thanks, very correct. Committed.

Status: Fixed » Closed (fixed)

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