Posted by gpk on September 28, 2009 at 2:17pm
6 followers
| Project: | Drupal core |
| Version: | 7.x-dev |
| Component: | user.module |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed (fixed) |
Issue Summary
Anonymous don't, in general, have a session any more. Therefore it's not possible to count how many there are.
The Who's online block always displays the number of (registered) users, but for some reason #201122: Drupal should support disabling anonymous sessions made the block also display the number of "guests" when (and only when) page caching is disabled. This code can I think all be safely removed. The <h3> heading "Online users" in the block itself can also probably be removed.
Comments
#1
Here is a patch that removes the code described above
#2
The last submitted patch failed testing.
#3
rerolled
#4
The last submitted patch failed testing.
#5
Need to remove code for anonymous users/sessions from user.test, including 1 assertion. Also there is text output onto the block's configuration page, and also on the system performance page, about the interaction with page caching, that needs to go.
#6
reroll with user.test changes and the block configuration change.
I'm not seeing the interaction with page caching on the system performance page though.
#7
>I'm not seeing the interaction with page caching on the system performance page
Yes I'm not seeing it either, for some reason it's not working and I just get a few errors such as:
The code is there in block.module, see http://api.drupal.org/api/function/block_form_system_performance_setting...
#8
rerolled. @gpk, I removed all the code you suggested.
#9
#10
This removes some horrible text that few people will understand, and a feature that will make zero sense with the new session handling - if you have page caching off, and that block enabled, then your site makes no sense. It's a bit of a shame, because that block is nice for vanity, but not enough of a shame to stop this being RTBC.
#11
This patch needs a quick re-roll.
#12
#13
rerolled.
#14
reRTBCed.
#15
<?php- $output .= theme('user_list', array('users' => $items, 'titles' => t('Online users')));
+ $output .= theme('user_list', array('users' => $items));
?>
?!?
#16
@Damien, not sure what I should do here. I removed the title stated in the original bug report.
#17
Oh yes, I see what Damien is asking.
Currently the block might look something like
WHO'S ONLINE
There are currently 3 users and 8 guests online.
Online users
- Damien
- Dries
- Moshe
What I proposed in the original issue was that the h3 "Online users" is now superfluous, since the block will only ever report online users, as follows according to my suggestion:
WHO'S ONLINE
There are currently 3 users online.
- Damien
- Dries
- Moshe
#18
The patch looks correct to me. Not sure what DamZ comment was about, but we can follow-up on it if necessary.
#19
Thanks Dries, possibly Damien hadn't realised that the removal of the "Online users" heading was intentional, or perhaps he was (also) flagging up the incorrect key 'titles' passed to theme_user_list in the original (should have been 'title'). Either way I think this is correct now.
#20
Automatically closed -- issue fixed for 2 weeks with no activity.