backdrop-contrib / references

References module for Backdrop CMS
GNU General Public License v2.0
2 stars 6 forks source link

PDOException when using the select list widget on a user reference field #9

Closed hosef closed 4 years ago

hosef commented 5 years ago

In Backdrop, the users_roles table had a column named rid changed to role. This change causes a PDOExcception in the References module when searching for users with a particular role for the select list.

Changing the column name in the query appears to fix the issue for me.

PDOException: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'r.rid' in 'where clause': SELECT u.* FROM {users} u INNER JOIN {users_roles} r ON u.uid = r.uid WHERE (r.rid IN (:db_condition_placeholder_0)) AND (u.uid <> :db_condition_placeholder_1) ORDER BY u.name ASC; Array ( [:db_condition_placeholder_0] => site_owner [:db_condition_placeholder_1] => 0 ) in _user_reference_potential_references_standard() (line 900 of /path/to/site/modules/contrib/references/user_reference/user_reference.module).

herbdool commented 4 years ago

Added bug fix (in my capacity as member of Bug Fix Team).