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

baldwinlouie’s picture

Status: Active » Needs review
StatusFileSize
new2.42 KB

Here is a patch that removes the code described above

Status: Needs review » Needs work

The last submitted patch failed testing.

baldwinlouie’s picture

Status: Needs work » Needs review
StatusFileSize
new2.46 KB

rerolled

Status: Needs review » Needs work

The last submitted patch failed testing.

gpk’s picture

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.

baldwinlouie’s picture

Status: Needs work » Needs review
StatusFileSize
new4.86 KB

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.

gpk’s picture

Status: Needs review » Needs work

>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:

Notice: Undefined index: page_cache in block_form_system_performance_settings_alter() (line 830 of /home/gelstgpk/public_html/drupal-7.x-dev-28Sep09/modules/block/block.module).

The code is there in block.module, see http://api.drupal.org/api/function/block_form_system_performance_setting...

baldwinlouie’s picture

StatusFileSize
new6.01 KB

rerolled. @gpk, I removed all the code you suggested.

baldwinlouie’s picture

Status: Needs work » Needs review
catch’s picture

Status: Needs review » Reviewed & tested by the community

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.

dries’s picture

This patch needs a quick re-roll.

dries’s picture

Status: Reviewed & tested by the community » Needs work
baldwinlouie’s picture

Status: Needs work » Needs review
StatusFileSize
new5.74 KB

rerolled.

catch’s picture

Status: Needs review » Reviewed & tested by the community

reRTBCed.

damien tournoud’s picture

Status: Reviewed & tested by the community » Needs work
-          $output .= theme('user_list', array('users' => $items, 'titles' => t('Online users')));
+          $output .= theme('user_list', array('users' => $items));

?!?

baldwinlouie’s picture

@Damien, not sure what I should do here. I removed the title stated in the original bug report.

gpk’s picture

Status: Needs work » Needs review

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

dries’s picture

Status: Needs review » Fixed

The patch looks correct to me. Not sure what DamZ comment was about, but we can follow-up on it if necessary.

gpk’s picture

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.

Status: Fixed » Closed (fixed)

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