When saving nodes that have field collections, I get this error (I realize this is specific to my site's DB):

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) )OR( (na.gid = :db_condition_placeholder_8) AND (na.realm = :db_condition_placeholder_9) ))AND (na.grant_view >= :db_condition_placeholder_10) ; Array ( [:db_condition_placeholder_0] => 2 [:db_condition_placeholder_1] => company_organization [:db_condition_placeholder_2] => 0 [:db_condition_placeholder_3] => all [:db_condition_placeholder_4] => 5 [:db_condition_placeholder_5] => content_access_author [:db_condition_placeholder_6] => 2 [:db_condition_placeholder_7] => content_access_rid [:db_condition_placeholder_8] => 7 [:db_condition_placeholder_9] => content_access_rid [:db_condition_placeholder_10] => 1 [:entity_type] => node ) in EntityFieldQuery->execute() (line 1136 of /var/www/html/fd/includes/entity.inc).

This may be a problem in Drupal core. I had Field Collection running on my site when it ran Drupal 7.10, and things worked. It was after my upgrade to Drupal 7.12 that I noticed the problems crop up.

Comments

visuaLatte’s picture

Note: I did delete all my fields, uninstall the module, and reinstalled it. I still get the error.

ktleow’s picture

Version: 7.x-1.0-beta3 » 7.x-1.0-beta4

Am having the same issue with 7.x-1.0-beta4 as well.

Could not save a node with Field Collection.

PDOException: SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'vid' cannot be null: INSERT INTO {node} (vid, type, language, title, uid, status, created, changed, comment, promote, sticky) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3, :db_insert_placeholder_4, :db_insert_placeholder_5, :db_insert_placeholder_6, :db_insert_placeholder_7, :db_insert_placeholder_8, :db_insert_placeholder_9, :db_insert_placeholder_10); Array ( [:db_insert_placeholder_0] => [:db_insert_placeholder_1] => article [:db_insert_placeholder_2] => und [:db_insert_placeholder_3] => Test article [:db_insert_placeholder_4] => 1 [:db_insert_placeholder_5] => 1 [:db_insert_placeholder_6] => 1342749543 [:db_insert_placeholder_7] => 1342749543 [:db_insert_placeholder_8] => 2 [:db_insert_placeholder_9] => 0 [:db_insert_placeholder_10] => 0 ) in drupal_write_record() (line 7013 of /Users/ktleow/htdocs/drupal7/includes/common.inc).
jmuzz’s picture

Status: Active » Postponed (maintainer needs more info)

@visuaLatte is it still happening? Maybe you can provide some details about the entity field query being run. If it's not yours then you can see how it is getting executed with a backtrace.

debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS)

@ktleow, that's a different error. It would be better to open a new issue for it if it's still happening.

jmuzz’s picture

Status: Postponed (maintainer needs more info) » Closed (cannot reproduce)