The subuser_get_parent function is returning the same uid as was passed in to the function. The issue is the the SQL query. It is currently

return db_result(db_query("SELECT uid FROM {subuser_relationship} WHERE uid = %d", $uid));

but I think it should be

return db_result(db_query("SELECT parent_id FROM {subuser_relationship} WHERE uid = %d", $uid));

Comments

blakehall’s picture

Status: Active » Fixed

You're absolutely right, I've pushed a fix for this to the 6.x-1.x branch.

Thanks!

Status: Fixed » Closed (fixed)

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