/cron/task/digests.php
is:Code: Select all
if (!in_array($this->path_prefix . 'includes/functions_content.' . $this->phpEx, get_included_files()))
Code: Select all
if (!function_exists('censor_text'))
Code: Select all
Error while creating image
» Error in [ROOT]/phpbb/user.php on line 599: DateTime::setTimezone() expects parameter 1 to be DateTimeZone, null given
The error occurs here on line 599 ofError in [ROOT]/phpbb/user.php on line 599: DateTime::setTimezone() expects parameter 1 to be DateTimeZone, null given
/phpbb/user.php
:Code: Select all
$time->setTimezone($this->timezone);
$this->timezone
must not be a PHP DateTime object somehow. Most likely the object does not exist although it should exist because Anonymous does have user_timezone
set to UTC.$user->format_date()
and if not creating it but it's not working or I'm doing something wrong.$user->format_date
. It's just that for some reason a timezone object attached to the user object seems to get lost for the guest account when it triggers a phpBB cron. It seems one or two may get out, but that's it./cron/task/digests.php
before line 866:Code: Select all
$publish_date = $this->language->lang('DIGESTS_PUBLISH_DATE', $row['username'], $this->user->format_date($recipient_time, $row['user_dateformat']));
Code: Select all
if (!is_object($this->user->timezone))
{
$this->user->timezone = new \DateTimeZone($this->config['board_timezone']);
}
Code: Select all
$message_datetime = $this->user->format_date($recipient_time, $user_row['user_timezone']);
Code: Select all
if (!is_object($this->user->timezone))
{
$this->user->timezone = new \DateTimeZone($this->config['board_timezone']);
}
Code: Select all
$post_datetime = $this->user->format_date($recipient_time, $user_row['user_dateformat']);
Code: Select all
if (!is_object($this->user->timezone))
{
$this->user->timezone = new \DateTimeZone($this->config['board_timezone']);
}
update phpbb_config set config_value = 0 where config_name = 'cron_lock'
The guest account has no timezone assigned. I had similar issues in my extension and solved it by picking up the board's timezone for the guest account. See https://github.com/canonknipser/viewexi ... hp#L81-L93 as an exampleMarkDHamill wrote: ↑Sat May 27, 2017 2:27 am It's just that for some reason a timezone object attached to the user object seems to get lost for the guest account