When trying to fill out the 'To' field of new private message, the autocomplete breaks. No visible error but the Drupal log tells me this:
Location http://www.example.net/nl/messages/user-name-autocomplete/deke
Referrer http://www.example.net/nl/messages/new
Message Not unique table/alias: 'users_user_relationships' query: SELECT users_user_relationships.name AS name FROM tr_user_relationships INNER JOIN users users_user_relationships ON user_relationships.requestee_id = users_user_relationships.uid INNER JOIN users users_user_relationships ON user_relationships.requestee_id = users_user_relationships.uid WHERE (name LIKE 'deke%') AND (user_relationships.approved = 1) AND (user_relationships.requester_id =1) ORDER BY name ASC LIMIT 0, 10 in /var/www/vhosts/example.net/httpdocs/sites/all/modules/privatemsg/privatemsg.module on line 994.
Where
- tr is the database prefix
- deke is the username I used for the 'To' field
This query is too complex for me to find the cause of the error. Anyone?
I'm using the latest dev of Privatemsg.
Comments
Comment #1
altparty commentedOther messages in my log:
Location http://www.example.net/nl/messages/user-name-autocomplete/deke
Referrer http://www.example.net/nl/messages/new
Message Table 'dbname.users' doesn't exist query: SELECT users_user_relationships.name AS name FROM tr_user_relationships INNER JOIN users users_user_relationships ON user_relationships.requestee_id = users_user_relationships.uid WHERE (name LIKE 'deke%') AND (user_relationships.approved = 1) AND (user_relationships.requester_id =1) ORDER BY name ASC LIMIT 0, 10 in /var/www/vhosts/example.net/httpdocs/sites/all/modules/privatemsg/privatemsg.module on line 994.
Comment #2
alex.k commentedCommitted a fix for this, http://drupal.org/cvs?commit=235350. Please give it a try. Thanks for reporting and the logs.
Comment #3
altparty commentedThanks for the instant reply. I applied the fix, but... now this log-entry appears:
Location http://www.example.net/nl/messages/user-name-autocomplete/deke
Referrer http://www.example.net/nl/messages/new
Message Unknown column 'user_relationships.approved' in 'where clause' query: SELECT users_user_relationships_1247160793.name AS name FROM tr_user_relationships INNER JOIN tr_users users_user_relationships_1247160793 ON user_relationships.requestee_id = users_user_relationships_1247160793.uid WHERE (name LIKE 'deke%') AND (user_relationships.approved = 1) AND (user_relationships.requester_id =1) ORDER BY name ASC LIMIT 0, 10 in /var/www/vhosts/example.net/httpdocs/sites/all/modules/privatemsg/privatemsg.module on line 994.
Comment #4
alex.k commentedCommitted an improvement in http://drupal.org/cvs?commit=235374. Basically the problem with the code is, it's not written to work with prefixed tables. I added aliases to both tables which should now work. Please give it a try. Thanks!
Comment #5
altparty commentedSuper! Works like a charm.
Thanks again for the support.
Comment #6
alex.k commentedThank you for testing!