Hello,

I made a content type. I added a user reference field. I attempted to create a node using that user reference field, and I get this:

The website encountered an unexpected error. Please try again later.

In my recent log entries, this seems to be the relevant entry:

PDOException: SQLSTATE[23000]: Integrity constraint violation: 1052 Column 'uid' in where clause is ambiguous: SELECT u.uid AS uid, u.name AS name, u.status AS status, r.rid AS rid FROM {users} u INNER JOIN {users_roles} r ON u.uid = r.uid WHERE (u.status IN (:db_condition_placeholder_0, :db_condition_placeholder_1)) AND (r.rid IN (:db_condition_placeholder_2, :db_condition_placeholder_3, :db_condition_placeholder_4, :db_condition_placeholder_5)) AND (uid IN (:db_condition_placeholder_6)) ORDER BY name ASC; Array ( [:db_condition_placeholder_0] => 1 [:db_condition_placeholder_1] => 0 [:db_condition_placeholder_2] => 4 [:db_condition_placeholder_3] => 0 [:db_condition_placeholder_4] => 0 [:db_condition_placeholder_5] => 0 [:db_condition_placeholder_6] => 70 ) in _user_reference_potential_references_standard() (line 491 of //sites/all/modules/references/user_reference/user_reference.module).

I currently cannot create nodes of this content type, so I'm marking this bug as major. I don't actually know how to make a patch, but it kinda looks like you'd just need to change (uid IN ...) to (u.uid IN ...) at that one point.

Comments

fgm’s picture

zwhalen’s picture

Ah, thanks. I didn't find that issue in my searching, but it is indeed the same problem.