? ? Pending

User tests: Successful: Unsuccessful:

avatar nhusung
nhusung
22 Apr 2020

Pull Request for Issue #28765.

Summary of Changes

Change the type of registerDate and lastvisitDate from \DateTime to string inside the DocBlocks of \Joomla\CMS\User\User.

Testing Instructions

We should verify that registerDate and lastvisitDate really are strings regardless of e.g. the database driver.

jtest.zip is a simple user plugin that can be used for testing. Just install and enable it, then the types of the current user object are shown on each login.

Expected result

The message should contain:

lastvisitDate: string
registerDate: string

Actual result

I tested this on J3.9.18 using MySQLi as well as J3.9.18 using MySQL PDO and in both cases the actual result was as expected.

Documentation Changes Required

Well, these are the (API) documentation changes.

avatar nhusung nhusung - open - 22 Apr 2020
avatar nhusung nhusung - change - 22 Apr 2020
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 22 Apr 2020
Category Libraries
avatar nhusung nhusung - change - 22 Apr 2020
The description was changed
avatar nhusung nhusung - edited - 22 Apr 2020
avatar nhusung nhusung - change - 22 Apr 2020
Title
[J4.0] Fix types of `registerDate` and `lastvisitDate` in Documentation
[J3.9] Fix types of `registerDate` and `lastvisitDate` in Documentation
avatar nhusung nhusung - edited - 22 Apr 2020
avatar nhusung nhusung - change - 22 Apr 2020
Title
[J3.9] Fix types of `registerDate` and `lastvisitDate` in Documentation
[3.9] Fix types of `registerDate` and `lastvisitDate` in Documentation
avatar nhusung nhusung - edited - 22 Apr 2020
avatar richard67
richard67 - comment - 23 Apr 2020

@mbabker Could you have a look on this PR? Is not a big thing, but I am not sure if it's right.

avatar nhusung nhusung - change - 23 Apr 2020
The description was changed
avatar nhusung nhusung - edited - 23 Apr 2020
avatar richard67
richard67 - comment - 23 Apr 2020

@nhusung Have you tested at least how it is with MySQL (PDO), compared to MySQLi?

avatar nhusung
nhusung - comment - 23 Apr 2020

Well, I should probably have done this before but here is a quick&dirty test plugin: jtest.zip

This is a simple user plugin that enqueues messages containing the types of the two properties right after login. With that I could confirm the error on J3.9.18 using MySQL PDO.

avatar nhusung nhusung - change - 23 Apr 2020
The description was changed
avatar nhusung nhusung - edited - 23 Apr 2020
avatar nhusung
nhusung - comment - 23 Apr 2020

Probably I still have to learn how to write proper tests but I guess the plugin suits our needs.

avatar richard67
richard67 - comment - 23 Apr 2020

Will test tomorrow or on weekend.

avatar zero-24
zero-24 - comment - 23 Apr 2020

Well it seems the fileds are defined as datetime fileds in the database:

`registerDate` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',

"registerDate" timestamp without time zone DEFAULT '1970-01-01 00:00:00' NOT NULL,

"lastvisitDate" datetime2(0) NOT NULL DEFAULT '1900-01-01 00:00:00',

But it also seems they are just strings with a defined format so this looks correct good.

avatar Quy Quy - test_item - 1 Jul 2020 - Tested successfully
avatar Quy
Quy - comment - 1 Jul 2020

I have tested this item successfully on e1c7199


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/28766.

avatar alikon alikon - test_item - 18 Jul 2020 - Tested successfully
avatar alikon
alikon - comment - 18 Jul 2020

I have tested this item successfully on e1c7199


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/28766.

avatar alikon alikon - change - 18 Jul 2020
Status Pending Ready to Commit
avatar alikon
alikon - comment - 18 Jul 2020

rtc


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/28766.

avatar HLeithner HLeithner - close - 17 Aug 2020
avatar HLeithner HLeithner - merge - 17 Aug 2020
avatar HLeithner HLeithner - change - 17 Aug 2020
Status Ready to Commit Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2020-08-17 08:53:05
Closed_By HLeithner
Labels Added: ? ?
avatar HLeithner
HLeithner - comment - 17 Aug 2020

Thanks

Add a Comment

Login with GitHub to post a comment