Problem/Motivation
In an install with Views not installed (i.e. minimal install), the 'Last access' column in the default People list shows the years since UNIX timestamp 0 for newly created users (or anybody that has never logged in).
Steps to reproduce:
- Do minimal install
- Create a new user
- Go to admin/people
Proposed resolution
Show 'never' like in the corresponding View.
Remaining tasks
User interface changes
Show something proper.
Before

After



| Comment | File | Size | Author |
|---|---|---|---|
| #20 | 2609504-19.png | 32.2 KB | mohit_aghera |
| #19 | users_show_never-2609504-19.patch | 1.79 KB | lendude |
| #16 | People-D8-2609504-16.png | 33.76 KB | mohit_aghera |
| #16 | interdiff-2609504-5-16.txt | 864 bytes | mohit_aghera |
| #16 | users_show_never-2609504-16.patch | 1.86 KB | mohit_aghera |
Comments
Comment #2
lendudeThis patch should fix it, but doesn't, because currently user.access and user.login default to 0 and not NULL. And since unix timestamp 0 is a perfectly valid non-empty timestamp, it's (rightly) not considered empty.
Will open a new issue to discuss the default values that need to be set to NULL.
Comment #3
lendudeDefaults issue #2609922: User access and login fields should default to NULL not 0
Comment #4
lendudeComment #5
lendudeFailing test and fix.
Still feel the fix in #2 is the way to go, but don't know if setting access to NULL has any other implications and how likely that is to actually make it in. The Views version of the people list deals with the 0 value, so just making the non-views version deal with it also makes sense.
Comment #7
lendudeComment #8
lendudeComment #9
ibustosI confirm the issue still exists when using the default date formatter. Attached an evidence.
Comment #10
mohit_aghera commented@ibustos
It's failing after applying patch. I've tested it with latest D8 head
see attached file.
Patched in comment #5 is working fine.
Comment #11
mohit_aghera commentedTesting patch #5
It seems appearing fine with latest D8 head
Comment #12
lendude@ibustos and @mohit_aghera thanks for looking at this!
About #9, as I pointed out in #1 and #2, 0 is a perfectly valid timestamp so making the default formatter interpret that as 'never' seems wrong to me (since it's Jan 1ste 1970). The patch in #5 is more of a work around to get the non-Views People display in line with the Views version.
I still think that actual fix for this should be what is outlined in #2, but that also feel a little like overkill for this issue, and not something that can be put into 8.0.x
Comment #13
lendudeputting this back on need review for #5
Comment #14
mohit_aghera commented@Lendude
Thanks for your input.
As per patch in comment #5 things are appearing fine.
See this comment https://www.drupal.org/node/2609504#comment-10837674
Hence, moving this into RTBC.
Comment #15
catchThis looks odd to me. Why not getLastAccessedTime()
Comment #16
mohit_aghera commentedThanks @Catch for pointing out the issue.
Adding updated patch with changes mentioned by you.
Uploaded relevant screenshot as well.
Comment #17
catchRTBC again assuming it comes back green.
Comment #18
catchThis needs a re-roll for 8.1.x
Comment #19
lendudeReroll for 8.1.x
Handled a little differently in 8.1, but still bugged.
Comment #20
mohit_aghera commentedTested #19 locally by applying patch.
Working fine. Screenshot attached.
Comment #23
catchCommitted/pushed to 8.1.x and 8.0.x thanks!