After installing Domain Access on an existing D7 development site, I'm getting this exception when trying to create a new item of a specific content type:
PDOException: SQLSTATE[23000]: Integrity constraint violation: 1052 Column 'nid' in where clause is ambiguous: SELECT DISTINCT node.nid AS entity_id, node.vid AS revision_id, node.type AS bundle, :entity_type AS entity_type FROM {node} node INNER JOIN {node_access} na ON na.nid = node.nid WHERE (nid IN (:db_condition_placeholder_0)) AND (type IN (:db_condition_placeholder_1)) AND(( (na.gid = :db_condition_placeholder_2) AND (na.realm = :db_condition_placeholder_3) )OR( (na.gid = :db_condition_placeholder_4) AND (na.realm = :db_condition_placeholder_5) )OR( (na.gid = :db_condition_placeholder_6) AND (na.realm = :db_condition_placeholder_7) ))AND (na.grant_view >= :db_condition_placeholder_8) ORDER BY node.title ASC; Array ( [:db_condition_placeholder_0] => 20 [:db_condition_placeholder_1] => tour [:db_condition_placeholder_2] => 0 [:db_condition_placeholder_3] => all [:db_condition_placeholder_4] => 0 [:db_condition_placeholder_5] => domain_site [:db_condition_placeholder_6] => 2 [:db_condition_placeholder_7] => domain_id [:db_condition_placeholder_8] => 1 [:entity_type] => node ) in EntityFieldQuery->execute() (line 1136 of /Volumes/Opus Locus/Sites/_drupal7/core/includes/entity.inc).
As far as I can tell there is nothing special about my config. MAMP 1.9, PHP 5.2.13, no PHP optimizer or caching. Drupal caches flushed, user permissions rebuilt...
One thought is that the content type includes two entity reference fields - other content types have none.
Comments
Comment #1
johnpitcairn commentedAh. See #1412642: Malformed sql query with domain access / node_access. I can't find any corresponding issue posted against Domain.
I did have "Restrict node views for administrators" set, but disabling that (and rebuilding access permissions) has no effect, I still can't create this content.
Comment #2
johnpitcairn commentedTitle change
Comment #3
agentrickardGiven that this module is 5 years older than Entity Reference, pushing to that queue. This looks like a generic node access query problem, not a DA specific problem.
Comment #4
damien tournoud commentedThis is a bug in core. See #1325628: EntityFieldQuery::propertyQuery missing fully qualified column names causes ambiguous column DB error.
Comment #5
dhruba.jyoti.saha commentedHey,
Try this..It worked for me - "http://drupal.org/node/1325628#comment-5571342".
Dhruba