From 3b3050959952ceae617b59246f364f4b0edd2dcd Mon Sep 17 00:00:00 2001 From: Angie Byron Date: Sat, 14 Mar 2009 23:01:38 +0000 Subject: #347250 by catch, drewish, and Berdir: Add function for loading multiple users in one request. --- modules/comment/comment.module | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'modules/comment/comment.module') diff --git a/modules/comment/comment.module b/modules/comment/comment.module index 177518c34..71b3ea219 100644 --- a/modules/comment/comment.module +++ b/modules/comment/comment.module @@ -1283,7 +1283,7 @@ function comment_validate($edit) { form_set_error('date', t('You have to specify a valid date.')); } } - if (isset($edit['author']) && !$account = user_load(array('name' => $edit['author']))) { + if (isset($edit['author']) && !$account = user_load_by_name($edit['author'])) { form_set_error('author', t('You have to specify a valid author.')); } @@ -1607,7 +1607,7 @@ function comment_form_add_preview($form, &$form_state) { // Attach the user and time information. if (!empty($edit['author'])) { - $account = user_load(array('name' => $edit['author'])); + $account = user_load_by_name($edit['author']); } elseif ($user->uid && !isset($edit['is_anonymous'])) { $account = $user; @@ -1687,7 +1687,7 @@ function _comment_form_submit(&$comment_values) { $comment_values['timestamp'] = strtotime($comment_values['date']); if (isset($comment_values['author'])) { - $account = user_load(array('name' => $comment_values['author'])); + $account = user_load_by_name($comment_values['author']); $comment_values['uid'] = $account->uid; $comment_values['name'] = $comment_values['author']; } -- cgit v1.2.3