"No active batch" error after cancelling account with who's online block enabled
David Poblador - January 4, 2003 - 19:39
| Project: | Drupal |
| Version: | 7.x-dev |
| Component: | user.module |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
Description
When a user is deleted after being online, its entry in "users online" block remains blank until the online expiry time is reached.

#1
#2
Once we add a hook at during user_delete(), it will be easy for stats module to delete all logs related to the deleted user.
priority => minor
#3
#4
I think its ok -but not that important- not to show that user on the block.
But deleting logs is a bad policiy.
As a site admin, I want to be able to see what's happened, even if the user who did something has been deleted from the system, the logs may be important.
#5
#6
i think this is solved .
<?php$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', array(':interval' => $interval), 0, $max_users)->fetchAll();
$output .= theme('user_list', $items, t('Online users'));
?>
This looks in the sessions table after logged in users.
and this sessions are removed, when blocking/canceling/delete users so i guess its not a issue any more
#7
Tried this out on an updated HEAD a while ago. I am able to easily cancel the account (w00t) and the "Who's Online" block does not show the deleted account.
But, after I visit the link to confirm cancellation, and once the account is canceled successfully, I get a one-time error - "No active batch". This error goes away on a page refresh. Why is that?
#8
i think this is a caching issue because the content of the block is cached
The block has BLOCK_CACE_PER_ROLE.
Did you tryed to clear the cache once.?
#9
As discussed on IRC with dereine, this hasn't got anything to do with block caching since the block is working fine. Its *after* the user has successfully canceled his account that the error message appears.
#10
The who's online block is actually in the user.module and has nothing to do with statistics.module.
#11
Proper title and status.