?
avatar nhusung
nhusung
22 Apr 2020

What needs to be fixed

To me it seems that the types of the properties lastvisitedDate and registerDate of \Joomla\CMS\User\User are wrong in the API documentation. I guess they should be string (at least if the other database drivers handle dates in a similar way compared to MySQLi).

/**
* Date the user was registered
*
* @var \DateTime
* @since 1.7.0
*/
public $registerDate = null;
/**
* Date of last visit
*
* @var \DateTime
* @since 1.7.0
*/
public $lastvisitDate = null;

Why this should be fixed

Thinking the lastvisitedDate property of \Joomla\CMS\User\User was an \DateTime object I tried to clone it in my own plugin in order to convert the date to a string in the User’s timezone. However, that gave me an error because the property actually was a string.

The issue occured on J3.9.16 using the MySQLi database driver.

How would you fix it

See #28766.

Side Effects expected

None.

avatar nhusung nhusung - open - 22 Apr 2020
avatar joomla-cms-bot joomla-cms-bot - change - 22 Apr 2020
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - labeled - 22 Apr 2020
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
[J3.x-4.0] Wrong types in API documentation
[3.x-4.0] Wrong types in API documentation
avatar nhusung nhusung - edited - 22 Apr 2020
avatar Quy Quy - change - 22 Apr 2020
Status New Closed
Closed_Date 0000-00-00 00:00:00 2020-04-22 21:48:13
Closed_By Quy
avatar Quy
Quy - comment - 22 Apr 2020

Closing as we have patch #28766

avatar Quy Quy - close - 22 Apr 2020

Add a Comment

Login with GitHub to post a comment