summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--userreference.module7
1 files changed, 4 insertions, 3 deletions
diff --git a/userreference.module b/userreference.module
index 243b5ef..87ba376 100644
--- a/userreference.module
+++ b/userreference.module
@@ -160,8 +160,9 @@ function userreference_field_formatter_info() {
*/
function theme_userreference_formatter_default($element) {
$output = '';
- if (isset($item['uid']) && $account = user_load(array('uid' => $item['uid']))) {
- $output = theme('username', $referenced_user);
+
+ if (isset($element['#item']['uid']) && $account = user_load(array('uid' => $element['#item']['uid']))) {
+ $output = theme('username', $account);
}
return $output;
}
@@ -171,7 +172,7 @@ function theme_userreference_formatter_default($element) {
*/
function theme_userreference_formatter_plain($element) {
$output = '';
- if (isset($item['uid']) && $account = user_load(array('uid' => $item['uid']))) {
+ if (isset($element['#item']['uid']) && $account = user_load(array('uid' => $element['#item']['uid']))) {
$output = $account->name;
}
return $output;