[drupal-devel] [bug] Watchdog does not display log messages for deleted users

Steven drupal-devel at drupal.org
Sat Feb 5 01:03:02 UTC 2005

 Project:      Drupal
 Version:      cvs
 Component:    watchdog.module
 Category:     bug reports
 Priority:     normal
 Assigned to:  Morbus Iff
 Reported by:  felixz
 Updated by:   Steven
 Status:       patch

I don't think this patch applies anymore. Perhaps we could instead keep
at least a minimal record of deleted users (i.e. name) to avoid this
problem instead? I agree with Dries that "deleted user" is not very
friendly. But I hate sites that don't delete you properly. Still, it
would seem in the best interest to keep the partial user record around
considering other modules. E.g. tracking a deleted user might be


Previous comments:

April 27, 2004 - 20:32 : felixz

watchdog_view function will do inner join with user table when selecting
messages for viewing.
I think its not right way to do it. If user was deleted error messages
for that user will be hidden from administrators view. 
I think it should do a right joing and if uid is NULL then display
(deleted) in the user collum for the message.
Why do i think this is important here is my explanation.
I am developing module. I deleted Anonymous User by accident then I
could not see any error logs that are generated by cron jobs.


July 1, 2004 - 02:56 : Morbus Iff

Attachment: http://drupal.org/files/issues/watchdog_deleted.patch (2.54 KB)

I've attached a patch that handles this, both in _overview and _view -
events assigned to users that were deleted will now show the
translatable "(deleted user)" under the User column.


July 6, 2004 - 18:48 : Dries

Normally, users are not able to delete the anonymous user.


July 6, 2004 - 23:33 : Morbus Iff

Dries - changing this back. The patch in question has nothing to do with
the Anonymous User (the original submitter's mention of it is a red
herring, and should be ignored - this has nothing to do with
anonymity). The original submitter describes a situation thusly:
a) Assume user #56 logs in.
b) Assume user #56 does something watchdoggable (login, comment, etc.).
c) Assume user #56 is deleted. Now, those watchdoggable items are no
longer shown.
In essence, the title: watchdog does not display log messages for
deleted users.


July 16, 2004 - 22:28 : Morbus Iff

Dries - any thoughts on this?


August 18, 2004 - 17:21 : Morbus Iff

I'm turning this into critical, in hopes of getting it into 4.5.0. Say
User #54 is being a prick and leaving zillions of comment spams. You
delete User #54 cos he sucks. A week later, you notice another User has
started leaving comment spams, and you have an inkling it's the same guy
- the times he leaves the comments coincide with "when the brat comes
home from school". Unfortunately, however, since User #54 ("where are
you!?!") is deleted, you won't see any of their related log entries
(even though they're still in the database), and thus, you have no way
of confirming it's the same person.


August 18, 2004 - 20:39 : Dries

This is not a critical feature: you are the first person to request it. 
I'm not happy with the way this patch presents information.  Adding
'deleted user' makes things look cluttered.  I'd simply display the
name of the deleted user like we do elsewhere (consistency).


August 25, 2004 - 15:18 : Morbus Iff

If the user is deleted, the only thing we have to go on is the saved uid
from the watchdog table, right? How would we get the user's username if
said user doesn't exist (for a proper uid lookup?). In fact, the
absence of the record in the users table is the only reason why this
Issue was created - the JOIN was failing because of it.

View: http://drupal.org/node/7428
Edit: http://drupal.org/project/comments/add/7428

More information about the drupal-devel mailing list