This started happening when saving existing articles. The issue does not occur on article creation.
I don't really know what triggered the issue but dumping $tz
value in libraries/joomla/date/date.php
returns int -5
Article successfully saved.
DateTime::__construct() expects parameter 2 to be DateTimeZone, integer given
Call stack
# Function Location
1 JApplicationCms->execute() /public_html/administrator/index.php:51
2 JApplicationAdministrator->doExecute() /public_html/libraries/cms/application/cms.php:257
3 JApplicationAdministrator->dispatch() /public_html/libraries/cms/application/administrator.php:152
4 JComponentHelper::renderComponent() /public_html/libraries/cms/application/administrator.php:98
5 JComponentHelper::executeComponent() /public_html/libraries/cms/component/helper.php:380
6 require_once() /public_html/libraries/cms/component/helper.php:405
7 JControllerLegacy->execute() /public_html/administrator/components/com_content/content.php:21
8 JControllerForm->save() /public_html/libraries/legacy/controller/legacy.php:728
9 JModelForm->validate() /public_html/libraries/legacy/controller/form.php:696
10 JForm->filter() /public_html/libraries/legacy/model/form.php:305
11 JForm->filterField() /public_html/libraries/joomla/form/form.php:229
12 JFactory::getDate() /public_html/libraries/joomla/form/form.php:1297
13 JDate->__construct() /public_html/libraries/joomla/factory.php:530
14 DateTime->__construct() /public_html/libraries/joomla/date/date.php:109
In libraries/joomla/date/date.php
line 92 to 102, why not add an else
clause to make sure the final $tz
actually is a DateTimeZone
object before constructing the DateTime
?
// If the time zone object is not set, attempt to build it.
if (!($tz instanceof DateTimeZone))
{
if ($tz === null)
{
$tz = self::$gmt;
}
elseif (is_string($tz))
{
$tz = new DateTimeZone($tz);
}
else {
$tz = self::$gmt;
}
}
Category | ⇒ | Libraries |
Labels |
Added:
?
|
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2016-05-14 08:50:58 |
Closed_By | ⇒ | brianteeman |
It sounds like
For fixing the first case, try this:
For the 2nd case