Details
-
Bug
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
0.11
-
Windows 7, Tomcat 7
Description
OSAPI query for retrieving friends is not returning any records.
It seems to be a problem between DefaultPersonService and its connections with PersonRepository and Person classes. Inside the DefaultPersonService, the userID (instead of the username) is passed as the USERNAME parameter, necessary to the named query Person.FIND_FRIENDS_BY_USERNAME. Hence, the query will always results in an empty dataset.
I've fixed it passing the username to the PersonRepository findFriends method, but I don't know if it's the better solution (I've started to study Rave about a week ago).
See the example bellow:
JS call:
osapi.people.get(
).execute(listFriends);
calls DefaultPersonService.getUniqueListOfFriends method:
for (UserId id : userIds)
NamedQuery called:
@NamedQuery(name = Person.FIND_FRIENDS_BY_USERNAME, query = "select a.followed from PersonAssociation a where a.follower.username = :username")