When activating any condition the default home page /node returns this error. It appears to be related to namespacing fields.

PDOException: SQLSTATE[23000]: Integrity constraint violation: 1052 Column 'promote' in where clause is ambiguous: SELECT COUNT(*) AS expression FROM (SELECT 1 AS expression FROM {node} n LEFT OUTER JOIN {db_temporary_0} node_overrides ON n.nid = node_overrides.id INNER JOIN {node_revision} override_node_revision ON COALESCE(node_overrides.override_revision_id, n.vid) = override_node_revision.vid WHERE ( (promote = :db_condition_placeholder_0) AND (status = :db_condition_placeholder_1) )) subquery; Array ( [:db_condition_placeholder_0] => 1 [:db_condition_placeholder_1] => 1 ) in PagerDefault->execute() (line 74 of /Users/indytechcook/projects/lsd_csi/drupal-7.14/includes/pager.inc).

Commenting the following lines in the react method clears the error for now

$this->addRevisionTables($query);
$alias = $this->extractAlias($query);
$this->encapCondition($where);

These comments basically backing out #1720830: The main where and having DatabaseCondition, can not get COALESCE put into the field

Comments

e2thex’s picture

Assigned: e2thex » indytechcook
Status: Active » Needs review

So this is because core does not alias its fields
#1728568: Add table alias in node query conditions to avoid ambiguous fields fixes this.

indytechcook’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

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