User tests: Successful: Unsuccessful:
Pull Request for Issue #41263 .
default to server tz if no user tz
edit your libraries/src/Console/ListUserCommand.php
use Joomla\CMS\HTML\HTMLHelper;
https://github.com/joomla/joomla-cms/blob/4.4-dev/libraries/src/Console/ListUserCommand.php#L18
and this line
$a=HTMLHelper::_('date', 'now', 'd F Y');
https://github.com/joomla/joomla-cms/blob/4.4-dev/libraries/src/Console/ListUserCommand.php#L108
run cli\joomla.php user:list
Call to a member function getTimezone() on null
no error
Please select:
Documentation link for docs.joomla.org:
No documentation changes for docs.joomla.org needed
Pull Request link for manual.joomla.org:
No documentation changes for manual.joomla.org needed
Status | New | ⇒ | Pending |
Category | ⇒ | Libraries |
Title |
|
I have tested this item ✅ successfully on c907c1e
I don't think this is a right fix and should be closed. We have to respect the value of argument passed to the method call, not changing under certain condition like this (if someone pass true to the method call, why do we change it to false) ?
Back to the original issue, I think people should not use HTMLHelper methods on a CLI script (isn't this class name show that we should only uses it on Html context ?) ? If someone wants to format a date like that, better create a date object and call format mehod instead (I don't check the timezone parameter here, just show the idea)
$date = Factory::getDate();
$date->format('d F Y');
Status | Pending | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2024-02-26 18:20:52 |
Closed_By | ⇒ | alikon | |
Labels |
Added:
bug
PR-4.4-dev
|
I think people should not use HTMLHelper methods on a CLI script
fully agree
Change it to the following. then there is no need to add the check.
$a=HTMLHelper::_('date', 'now', 'd F Y', false);