cheers,
on manual ticket creation I got this php error since today in the morning. Trace
[Wed Jul 03 06:53:39.487356 2024] [php:error] [pid 14524] [client 172.16.x.x:41184] PHP Fatal error: Uncaught DateMalformedStringException: DateTime::modify(): Failed to parse time string (Montag 2024-07-06) at position 0 (M): The timezone could not be found in the database in /srv/www/osTicket-18.1/include/class.schedule.php:802\nStack
trace:\n
#0 /srv/www/osTicket-18.1/include/class.schedule.php(802): DateTime->modify()\n
#1 /srv/www/osTicket-18.1/include/class.schedule.php(851): ScheduleEntry->getCurrent()\n
#2 /srv/www/osTicket-18.1/include/class.businesshours.php(70): ScheduleEntry->getOccurrences()\n
#3 /srv/www/osTicket-18.1/include/class.businesshours.php(106): BusinessHours->initOccurrences()\n
#4 /srv/www/osTicket-18.1/include/class.schedule.php(479): BusinessHours->addWorkingHours()\n
#5 /srv/www/osTicket-18.1/include/class.sla.php(55): BusinessHoursSchedule->addWorkingHours()\n
#6 /srv/www/osTicket-18.1/include/class.ticket.php(557): SLA->addGracePeriod()\n
#7 /srv/www/osTicket-18.1/include/class.ticket.php(568): Ticket->getSLADueDate()\n
#8 /srv/www/osTicket-18.1/include/class.ticket.php(4538): Ticket->updateEstDueDate()\n
#9 /srv/www/osTicket-18.1/include/class.ticket.php(4642): Ticket::create()\n
#10 /srv/www/osTicket-18.1/scp/tickets.php(426): Ticket::open()\n
#11 {main}\n thrown in /srv/www/osTicket-18.1/include/class.schedule.php on line 802, referer: https://support.xxx.xxx/scp/tickets.php?a=open&uid=12
I tracked the issue down to the static arrays $days, $weeks and $months @class.schedule.php, class ScheduleEntry (line 558 ongoing).
Dirty patch:
I duplicated the arrays to $daysEN, $weeksEN and $monthsEN and removed the /* @trans */ prefix.
protected static $frequenciesEN = array(
'never' => 'Once',
'daily' => 'Daily',
'weekly' => 'Weekly',
'monthly' => 'Monthly',
'yearly' => 'Yearly',
);
protected static $daysEN = array(
1 => 'Monday',
2 => 'Tuesday',
3 => 'Wednesday',
4 => 'Thursday',
5 => 'Friday',
6 => 'Saturday',
7 => 'Sunday',
);
protected static $weeksEN = array(
1 => 'First',
2 => 'Second',
3 => 'Third',
4 => 'Fourth',
5 => 'Fifth',
-1 => 'Last',
);
protected static $monthsEN = array( 1 =>
'January',
'February',
'March',
'April',
'May',
'June',
'July',
'August',
'September',
'October',
'November',
'December'
);
Furthermore I changed the function ScheduleEntry->getIntervalSpec:
function getIntervalSpec(Datetime $dt) {
$info = $this->getInfo();
switch ($info['repeats']) {
case 'never':
$starts = $this->getStartsDatetime();
return $starts->format('Y-m-d');
break;
case 'daily':
return sprintf('%s %s',
'today', $dt->format('Y-m-d'));
break;
case 'weekdays':
if ($dt->format('N') > 5)
return 'weekday';
else
return sprintf('%s %s',
'today', $dt->format('Y-m-d'));
break;
case 'weekends':
if ($dt->format('N') > 5)
return sprintf('%s %s',
'today', $dt->format('Y-m-d'));
else
return sprintf('Next Saturday %s',
$dt->format('Y-m-d'));
break;
case 'weekly':
return sprintf('%s %s',
self::$daysEN[$info['day']],
$dt->format('Y-m-d'));
break;
case 'monthly':
if (!$info['week'] && $info['day']> 0)
return sprintf('%s-%s',
$dt->format('Y-m'),
$info['day']);
else
return sprintf('%s %s of %s %d',
self::$weeksEN[$info['week']],
self::$daysEN[$info['day']],
$dt->format('F'),
$dt->format('Y'));
break;
case 'yearly':
if ($info['week'] > 0) {
return sprintf('%s %s %s %s',
self::$monthsEN[$info['month']],
$dt->format('Y'),
self::$weeksEN[$info['week']],
self::$daysEN[$info['day']]);
} elseif ($info['week'] == -1) {
return sprintf('last %s of %s %s',
self::$daysEN[$info['day']],
self::$monthsEN[$info['month']],
$dt->format('Y'));
} else {
return sprintf('%s %d %d',
self::$monthsEN[$info['month']],
$info['day'],
$dt->format('Y'));
}
break;
}
}
Before the error did not occur.
Is FYI.