Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Once a user has been switched from active to blocked state in user administration, their "Member since:" date shows since UNIX epoch.
Comment | File | Size | Author |
---|---|---|---|
#4 | user.module_4.patch | 415 bytes | viksit |
blockeduserepoch.png | 4.15 KB | deekayen |
Comments
Comment #1
deekayen CreditAttribution: deekayen commentedSo far I blame the query in user_load() which comes out something like:
Then user_load() never calls user_module_invoke() in the db_num_rows() if statement because blocked users don't return because of the
LOWER(u.status) = '1'
in the query. So when user_user does math on an empty $user object, the date comes out wrong when loading the view page on a blocked user.I don't know why the if statement of user_view() forces
'status' => 1
, but if you remove it, the blocked user "Member since" date is corrected.The only call I saw for user_view() in grep was in user_page().
One of the side effects of this bug was blocked users didn't have anything show under their History part of their View tab. For example, removing
'status' => 1
will show "view recent blog entries" if you have blog.module loaded. I don't really think that's my position to say if that's a desireable behavior or not, so I'll just leave this hanging. I also don't really know what status > 1 would mean, so it might instead be desireable to make a change so the query in user_load() grabsLOWER(u.status) <= '1'
.Comment #2
viksit CreditAttribution: viksit commentedLooking at it.
Comment #3
viksit CreditAttribution: viksit commentedAh, assigned.
Comment #4
viksit CreditAttribution: viksit commentedWell, I tried alternate approaches, but what seemed to work best was as suggested above.
The patch's attached here..
Cheers,
Comment #5
viksit CreditAttribution: viksit commenteduploaded above..
Comment #6
Bèr Kessels CreditAttribution: Bèr Kessels commentedHmm, I dislike the idea of this. Simply taking out that status =1 parameter, will show blocked users on certain areas, where you /dont/ want them to show up at all.
The user page, for one, must not be accessible for users that are blocked.
Comment #7
Robin Monks CreditAttribution: Robin Monks commented-1 from me too.
This has far reaching consequences. Can't we just fix the date query?
Robin
Comment #8
deekayen CreditAttribution: deekayen commentedappears to be fixed in HEAD
Comment #9
(not verified) CreditAttribution: commented