User Relationships integration with Privatemsg autocomplete error

truelove-nl - July 8, 2009 - 20:30
Project:User Relationships
Version:6.x-1.0-rc1
Component:Code
Category:bug report
Priority:normal
Assigned:alex.k
Status:closed
Description

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.

#1

truelove-nl - July 9, 2009 - 16:47

Other 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.

#2

alex.k - July 9, 2009 - 17:03
Assigned to:Anonymous» alex.k

Committed a fix for this, http://drupal.org/cvs?commit=235350. Please give it a try. Thanks for reporting and the logs.

#3

truelove-nl - July 9, 2009 - 17:41

Thanks 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.

#4

alex.k - July 9, 2009 - 18:16

Committed 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!

#5

truelove-nl - July 9, 2009 - 18:24

Super! Works like a charm.

Thanks again for the support.

#6

alex.k - July 9, 2009 - 18:29
Status:active» fixed

Thank you for testing!

#7

System Message - July 23, 2009 - 18:30
Status:fixed» closed

Automatically closed -- issue fixed for 2 weeks with no activity.

 
 

Drupal is a registered trademark of Dries Buytaert.