Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

thislogin and lastlogin are the same value, but different with :ago modifier #139

Open
squarou opened this issue Nov 8, 2018 · 1 comment

Comments

@squarou
Copy link

squarou commented Nov 8, 2018

Hi,
I opened this issue (modxcms/revolution#14130) in the core repo, but thanks to @Jako now I know that I'm in the right place.

Summary

In users attributes, thislogin and lastlogin are the same values. I can't use a real lastlogin

Step to reproduce

Put this in a page after the user's loggedin (tested with a normal user - not administrator).

[[!Profile? &prefix=`user.`]]
[[!+user.lastlogin:date=`%d-%m-%Y %H-%M`]]
[[!+user.thislogin:date=`%d-%m-%Y %H-%M`]]

and

[[!+user.lastlogin]]
[[!+user.thislogin]]

Observed behavior

In both cases, the 2 dates (values) are the same.
But : using ago modifier [[!+user.lastlogin:date=`%d-%m-%Y`:ago]] seem to output the right value, the one stored in DB before the user loggedin.

[[!+user.lastlogin]] ==> 1541682071
[[!+user.lastlogin:ago]] ==> il y a 14 heures, 11 min
[[!+user.lastlogin:date=%d-%m-%Y %H-%M]] ==> 08-11-2018 1401

[[!+user.thislogin]] ==> 1541682071
[[!+user.thislogin:ago]] ==> il y a 14 heures, 11 min
[[!+user.thislogin:date=%d-%m-%Y %H-%M]] ==> 08-11-2018 1401

Expected behavior

I guess that [[+lastlogin]] should display the last time the user loggedin and [[!+user.lastlogin]]
[[!+user.thislogin]] should be quite different.

[[!+user.lastlogin]] ==> 1541624471
[[!+user.lastlogin:ago]] ==> il y a 14 heures, 11 min
[[!+user.lastlogin:date=%d-%m-%Y %H-%M]] ==> 07-11-2018 2201

[[!+user.thislogin]] ==> 1541682071
[[!+user.thislogin:ago]] ==> il y a 0 heures, 1 min
[[!+user.thislogin:date=%d-%m-%Y %H-%M]] ==> 08-11-2018 1401

Environment

MODX 2.6.5
Login 1.9.7-pl

@yuliyepes
Copy link

There some way to fix it at least temporarily?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants