We have a cli script that includes some code to use the date helper to format a date. like this:
HTMLHelper::_('date', $uit['ourdate'], 'd F Y'),
The HTML helper does not get a timezone ($tz) value so it is set to default 'true'. Then it tries to get the timezone"
$date->setTimezone($app->getIdentity()->getTimezone());
But this does not seem to work from the frontend context where the cli script is running. Running the same script from the backend does not cause an error. The error is:
"Call to a member function getTimezone() on null"
message: "Call to a member function getTimezone() on null"
code: 0
file: "./domains/oursite.nl/public_html/libraries/src/HTML/HTMLHelper.php"
line: 873
$app is not set / use properly when run from a CLI script?
Should the helper work OK from a cli script? If yes, is this a bug? If no, how could we get it to work?
Labels |
Added:
No Code Attached Yet
|
Title |
|
Labels |
Added:
bug
|
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2024-02-04 07:48:27 |
Closed_By | ⇒ | alikon |
please test #42754