diff options
author | Angie Byron <webchick@24967.no-reply.drupal.org> | 2009-03-14 23:01:38 +0000 |
---|---|---|
committer | Angie Byron <webchick@24967.no-reply.drupal.org> | 2009-03-14 23:01:38 +0000 |
commit | 3b3050959952ceae617b59246f364f4b0edd2dcd (patch) | |
tree | b7cc39b97156ee0f346334d1e8dd78b5662c40e7 /modules/node | |
parent | 8a0d326a8e134ad4261b9575ce073f9e44b72f60 (diff) | |
download | brdo-3b3050959952ceae617b59246f364f4b0edd2dcd.tar.gz brdo-3b3050959952ceae617b59246f364f4b0edd2dcd.tar.bz2 |
#347250 by catch, drewish, and Berdir: Add function for loading multiple users in one request.
Diffstat (limited to 'modules/node')
-rw-r--r-- | modules/node/node.module | 4 | ||||
-rw-r--r-- | modules/node/node.pages.inc | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/modules/node/node.module b/modules/node/node.module index a83cfbdc5..1772759e7 100644 --- a/modules/node/node.module +++ b/modules/node/node.module @@ -984,7 +984,7 @@ function node_validate($node, $form = array()) { if (user_access('administer nodes')) { // Validate the "authored by" field. - if (!empty($node->name) && !($account = user_load(array('name' => $node->name)))) { + if (!empty($node->name) && !($account = user_load_by_name($node->name))) { // The use of empty() is mandatory in the context of usernames // as the empty string denotes the anonymous user. In case we // are dealing with an anonymous user we set the user ID to 0. @@ -1035,7 +1035,7 @@ function node_submit($node) { if (user_access('administer nodes')) { // Populate the "authored by" field. - if ($account = user_load(array('name' => $node->name))) { + if ($account = user_load_by_name($node->name)) { $node->uid = $account->uid; } else { diff --git a/modules/node/node.pages.inc b/modules/node/node.pages.inc index 06fc66988..e0481e0fe 100644 --- a/modules/node/node.pages.inc +++ b/modules/node/node.pages.inc @@ -353,7 +353,7 @@ function node_preview($node) { if (isset($node->name)) { // The use of isset() is mandatory in the context of user IDs, because // user ID 0 denotes the anonymous user. - if ($user = user_load(array('name' => $node->name))) { + if ($user = user_load_by_name($node->name)) { $node->uid = $user->uid; $node->picture = $user->picture; } @@ -362,7 +362,7 @@ function node_preview($node) { } } elseif ($node->uid) { - $user = user_load(array('uid' => $node->uid)); + $user = user_load($node->uid); $node->name = $user->name; $node->picture = $user->picture; } |