All this function is is a wrapper around theme_item_list.
Can we please just prepare the user $items ahead of time and call theme_item_list as usual?

(Tagging for Twig as well, because it will be one less theme function for us to convert)

Comments

sun’s picture

Title: remove theme_user_list from core » Remove theme_user_list() from core
Status: Active » Needs review
Issue tags: +Theme Component Library
StatusFileSize
new3.79 KB

Nothing simpler than that. :)

Status: Needs review » Needs work

The last submitted patch, drupal8.theme-user-list.1.patch, failed testing.

andypost’s picture

Fixed tests - test assumes that block content is rendered
Do not use $user :)

andypost’s picture

Status: Needs work » Needs review
moshe weitzman’s picture

Status: Needs review » Reviewed & tested by the community

Nice work. I

Ideally, the block content would be an array containing the Who's online text (as a #markup) and then the list. The use of #prefix is discouraged. Since that ugliness predates this patch, I'm fine with going right to RTBC as is.

catch’s picture

Title: Remove theme_user_list() from core » Change notification for: Remove theme_user_list() from core
Priority: Normal » Critical
Status: Reviewed & tested by the community » Active

Nice. Committed/pushed to 8.x.

This will need a change notification, ideally we'd have a single one for "removed theme functions" that'll work for #1598886: Clean up pager theme functions and similar too.

webchick’s picture

We are now over thresholds on critical tasks, so this and other issues with outstanding change notices are blocking features in D8. Please fix.

andypost’s picture

Status: Active » Needs work
+++ b/core/modules/user/user.moduleundefined
@@ -848,10 +845,15 @@ function user_block_view($delta = '') {
+        $block['content'] = array(
+          '#theme' => 'item_list__user__new',
+          '#items' => array(),
+        );

@@ -864,17 +866,22 @@ function user_block_view($delta = '') {
+        $block['subject'] = t('Who\'s online');
+        $block['content'] = array(
+          '#theme' => 'item_list__user__online',
+          '#items' => array(),
+          '#prefix' => '<p>' . format_plural($authenticated_count, 'There is currently 1 user online.', 'There are currently @count users online.') . '</p>',
+        );
 

Changelog should point that user_list now exposed as renderable array and there's no theme_user_list in core

+++ b/core/modules/user/user.moduleundefined
@@ -1082,30 +1089,6 @@ function theme_username($variables) {
-function theme_user_list($variables) {

deprecated theme_* function

xjm’s picture

Status: Needs work » Active
Issue tags: +Needs change record

Thanks @andypost. Setting back to active and tagging for someone to write the change notification. (Include @andypost's points above and see #6. )

podarok’s picture

Title: Remove theme_user_list() from core » Change notification for: Remove theme_user_list() from core
Assigned: podarok » Unassigned

#9 first(may be last :) ) try in http://drupal.org/node/1795832

podarok’s picture

Title: Change notification for: Remove theme_user_list() from core » Remove theme_user_list() from core
Assigned: Unassigned » podarok
Status: Active » Needs review
Issue tags: -Needs change record

better title and status

andypost’s picture

Title: Change notification for: Remove theme_user_list() from core » Remove theme_user_list() from core
Assigned: Unassigned » podarok
Status: Needs review » Fixed

Suppose http://drupal.org/node/1795832 is a good idea because we need a place for all removed theme functions

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

xjm’s picture

Priority: Critical » Normal

Recategorizing.