- Issue created by @yazzbe
Error with no english dates on the remote website
When the remote website is refreshed in the dashboerd and has non-English date format as default. The SGD dasboard gets a fatal error (WSOD).
on line 554 of file sgd_dashboard/src/Plugin/SgdCompanion/SgdCompanionSgdCore.php
replace code with:
case 'cron_last_run':
$lastRunString = substr($status['value'], strlen('Last run '));
try {
$lastRun = new \DateTime($lastRunString);
$threshold = new \DateTime('1 day ago');
if ($lastRun < $threshold) {
$validation[$key] = [
'class' => 'error',
'text' => $this->t('Issue'),
'message' => $this->t('CRON has not run for more than a day.'),
];
}
else {
$validation[$key] = [
'class' => 'ok',
'text' => $this->t('OK'),
];
}
}
catch (\Exception $e) {
// if parsing fails, show message
$validation[$key] = [
'class' => 'warning',
'text' => $this->t('Unknown'),
'message' => $this->t('Unable to parse CRON run time: @string', ['@string' => $lastRunString]),
];
}
break;
Active
1.0
Code