diff --git a/core/modules/user/lib/Drupal/user/Tests/UserBlocksTests.php b/core/modules/user/lib/Drupal/user/Tests/UserBlocksTests.php index a0cee51..79503cf 100644 --- a/core/modules/user/lib/Drupal/user/Tests/UserBlocksTests.php +++ b/core/modules/user/lib/Drupal/user/Tests/UserBlocksTests.php @@ -107,6 +107,7 @@ class UserBlocksTests extends WebTestBase { // Test block output. $block = user_block_view('online'); + $block['content'] = render($block['content']); $this->drupalSetContent($block['content']); $this->assertRaw(t('2 users'), t('Correct number of online users (2 users).')); $this->assertText($user1->name, t('Active user 1 found in online list.')); diff --git a/core/modules/user/user.module b/core/modules/user/user.module index 635675c..3e06bb6 100644 --- a/core/modules/user/user.module +++ b/core/modules/user/user.module @@ -851,8 +851,8 @@ function user_block_view($delta = '') { '#theme' => 'item_list__user__new', '#items' => array(), ); - foreach ($items as $user) { - $block['content']['#items'][] = theme('username', array('account' => $user)); + foreach ($items as $account) { + $block['content']['#items'][] = theme('username', array('account' => $account)); } } return $block; @@ -878,8 +878,8 @@ function user_block_view($delta = '') { if ($authenticated_count && $max_users) { $items = db_query_range('SELECT u.uid, u.name, MAX(s.timestamp) AS max_timestamp FROM {users} u INNER JOIN {sessions} s ON u.uid = s.uid WHERE s.timestamp >= :interval AND s.uid > 0 GROUP BY u.uid, u.name ORDER BY max_timestamp DESC', 0, $max_users, array(':interval' => $interval))->fetchAll(); - foreach ($items as $user) { - $block['content']['#items'][] = theme('username', array('account' => $user)); + foreach ($items as $account) { + $block['content']['#items'][] = theme('username', array('account' => $account)); } } }