When a user is deleted after being online, its entry in "users online" block remains blank until the online expiry time is reached.

CommentFileSizeAuthor
#7 no-active-batch.jpg127.41 KBlut4rp
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Anonymous’s picture

moshe weitzman’s picture

Title: Blank entry in "users online" » Blank entry in
Priority: Normal » Minor

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

Kjartan’s picture

Title: Blank entry in » Deleted users show in who is online block
Category: bug » feature
Jose Reyero’s picture

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.

LAsan’s picture

Version: » 7.x-dev
dawehner’s picture

Status: Active » Postponed (maintainer needs more info)

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

lut4rp’s picture

FileSize
127.41 KB

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?

dawehner’s picture

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.?

lut4rp’s picture

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.

Dave Reid’s picture

Component: statistics.module » user.module

The who's online block is actually in the user.module and has nothing to do with statistics.module.

sun.core’s picture

Title: Deleted users show in who is online block » "No active batch" error after cancelling account with who's online block enabled
Category: feature » bug
Priority: Minor » Normal
Status: Postponed (maintainer needs more info) » Active

Proper title and status.

Jody Lynn’s picture

I could not reproduce this. I enabled the who's online block and cancelled accounts and got no error.

j0rd’s picture

I just re-produced this 8 year old bug.

I need it fixed. It makes absolutely no sense to the end user.

To produce in Drupal 7, Create an account. Delete account. Visit email to get your cancel link. Click link. See this message.

Not sure if it has to do with "online block", but I do have that enabled in the users profile section. aka user/UID

--
Drupal Commerce Themes & Development

mikran’s picture

Error is not only related to user cancel but user_save also. If currently logged in user performs batch operation which does user_save the batch operation is unable to continue. The "online block" has no effect on results.

Example can be found from user import framework module. Related issue with workaround fix: http://drupal.org/node/1221972.

carl.brown’s picture

I've got the same problem in D7 - user clicks link in email to cancel/delete their account and sees this message/error - I DONT have the who's online block enabled however, so it would appear to be unrelated. Anyone have ideas on a fix for this?

Rob C’s picture

can we mark this as a dupe of
http://drupal.org/node/1034828
and more modules have related issues
http://drupal.org/node/1221972

Devin Carlson’s picture

Status: Active » Closed (duplicate)

We sure can mark this as a duplicate.

Marking as a duplicate of #1034828: "No active batch" error after user cancelling own account as it seems to have more up-to-date information, even though this issue is older.

jdieter’s picture

Admin cannot cancel and delete any users. they never go away. Need them completely deleted. get no active batch. page freezes after "are you sure" in disabled (darkened) mode. Cant delete any user.