Commit 1bc5fe18 authored by Dries's avatar Dries

- Patch #20058: move user_module_invoke('load', $array, $user) after loading of roles.

parent 495a03ae
......@@ -66,13 +66,13 @@ function user_load($array = array()) {
if (db_num_rows($result)) {
$user = db_fetch_object($result);
$user = drupal_unpack($user);
user_module_invoke('load', $array, $user);
$user->roles = array();
$result = db_query('SELECT r.rid, r.name FROM {role} r INNER JOIN {users_roles} ur ON ur.rid = r.rid WHERE ur.uid = %d', $user->uid);
while ($role = db_fetch_object($result)) {
$user->roles[$role->rid] = $role->name;
}
user_module_invoke('load', $array, $user);
}
else {
$user = new StdClass();
......
......@@ -66,13 +66,13 @@ function user_load($array = array()) {
if (db_num_rows($result)) {
$user = db_fetch_object($result);
$user = drupal_unpack($user);
user_module_invoke('load', $array, $user);
$user->roles = array();
$result = db_query('SELECT r.rid, r.name FROM {role} r INNER JOIN {users_roles} ur ON ur.rid = r.rid WHERE ur.uid = %d', $user->uid);
while ($role = db_fetch_object($result)) {
$user->roles[$role->rid] = $role->name;
}
user_module_invoke('load', $array, $user);
}
else {
$user = new StdClass();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment