Skip to content

Commit

Permalink
Fixed #2761
Browse files Browse the repository at this point in the history
  • Loading branch information
brandonkelly committed Apr 26, 2018
1 parent 68251ad commit 12f83c0
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
1 change: 1 addition & 0 deletions CHANGELOG-v3.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
### Fixed
- Fixed an error that would occur on servers without the Phar PHP extension enabled.
- Fixed an error that could occur if a Matrix block was deleted by a queue job. ([#2813](https://github.com/craftcms/cms/issues/2813))
- Fixed a bug where Twig could be configured to output times in UTC rather than the system timezone, if a bootstrapped module was loading Twig. ([#2761](https://github.com/craftcms/cms/issues/2761))

## 3.0.4 - 2018-04-24

Expand Down
9 changes: 4 additions & 5 deletions src/console/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,11 @@ public function __construct($config = [])
*/
public function init()
{
parent::init();

// Set default timezone to UTC
date_default_timezone_set('UTC');

$this->state = self::STATE_INIT;
// Important that we call $this->_init() before parent::init(), so that it's run before bootstrap()
// in case bootstrap() ends up loading a module that loads Twig, configuring Twig with the wrong timezone
$this->_init();
parent::init();
}

/**
Expand Down
6 changes: 4 additions & 2 deletions src/web/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,11 @@ public function __construct(array $config = [])
*/
public function init()
{
parent::init();

$this->state = self::STATE_INIT;
// Important that we call $this->_init() before parent::init(), so that it's run before bootstrap()
// in case bootstrap() ends up loading a module that loads Twig, configuring Twig with the wrong timezone
$this->_init();
parent::init();
$this->ensureResourcePathExists();
$this->debugBootstrap();
}
Expand Down

0 comments on commit 12f83c0

Please sign in to comment.