summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorShabanaBlackborder2013-09-16 05:13:49 (GMT)
committer ShabanaBlackborder2013-09-16 05:13:49 (GMT)
commitf83fddbb8d1acb1ca50bbbe59395f5c313b4acfd (patch)
treed40c228d5751789bff18c5d05a44dd8c71a9937b
parent27a22b24d51f1af65d96504d8b4a75a2d50b77f2 (diff)
Issue #2087757 by Shabana Blackborder: Fixed Undefined variable: account -theme_user_badge().
-rw-r--r--user_badges.module10
1 files changed, 7 insertions, 3 deletions
diff --git a/user_badges.module b/user_badges.module
index dd9c90f..30a6b81 100644
--- a/user_badges.module
+++ b/user_badges.module
@@ -1234,7 +1234,11 @@ function theme_user_badge($variables) {
// Implement token replacement.
if (module_exists('token')) {
- $href = token_replace($href, array('userbadge' => $badge, 'user' => $account));
+ $vars = array('userbadge' => $badge);
+ if (isset($variables['account'])) {
+ $vars['user'] = $variables['account'];
+ }
+ $href = token_replace($href, $vars);
}
$pieces = parse_url($href);
@@ -1305,7 +1309,7 @@ function user_badges_block_view($delta = 0) {
$result = isset($account->badges) ? $account->badges : array();
$images = array();
foreach ($result as $badge) {
- $images[] = theme('user_badge', array('badge' => $badge));
+ $images[] = theme('user_badge', array('badge' => $badge, 'account' => $account));
}
$block['subject'] = t("@name's Badges", array('@name' => $node->name));
$block['content'] = theme('user_badge_group', array('badgeimages' => $images));
@@ -1326,7 +1330,7 @@ function user_badges_block_view($delta = 0) {
}
$images = array();
foreach ($result as $badge) {
- $images[] = theme('user_badge', array('badge' => $badge));
+ $images[] = theme('user_badge', array('badge' => $badge, 'account' => $user));
}
$block['subject'] = t('My Badges');
$block['content'] = theme('user_badge_group', array('badgeimages' => $images));