if (CRM_Core_Config::environment() != 'Production') {
CRM_Core_Session::setStatus(ts('Execution of scheduled jobs has been turned off by default since this is a non-production environment. You can override this for particular jobs by adding runInNonProductionEnvironment=TRUE as a parameter.'), ts("Non-production Environment"), "warning", array('expires' => 0));
}
+ else {
+ $cronError = Civi\Api4\System::check(FALSE)
+ ->addWhere('name', '=', 'checkLastCron')
+ ->addWhere('severity_id', '>', 1)
+ ->setIncludeDisabled(TRUE)
+ ->execute()
+ ->first();
+ if ($cronError) {
+ CRM_Core_Session::setStatus($cronError['message'], $cronError['title'], 'alert', ['expires' => 0]);
+ }
+ }
$sj = new CRM_Core_JobManager();
$rows = $temp = [];
// After 1 day (86400 seconds) increase the error level
$level = ($lastCron > $now - 86400) ? \Psr\Log\LogLevel::WARNING : \Psr\Log\LogLevel::ERROR;
}
- $msg .= '<p>' . ts('To enable scheduling support, please set up the cron job.') .
+ $msg .= '<p>' . ts('A cron job is required to execute scheduled jobs automatically.') .
'<br />' . CRM_Utils_System::docURL2('sysadmin/setup/jobs/') . '</p>';
}
// interface can be disabled in more change to the configuration file.
// first check for civicrm site key
if (!CRM_Utils_System::authenticateKey(FALSE)) {
- $docLink = CRM_Utils_System::docURL2("Managing Scheduled Jobs", TRUE, NULL, NULL, NULL, "wiki");
+ $docLink = CRM_Utils_System::docURL2('sysadmin/setup/jobs', TRUE);
$key = $requestParams['key'] ?? NULL;
if (empty($key)) {
return self::error("FATAL: mandatory param 'key' missing. More info at: " . $docLink);
// also make sure the key is sent and is valid
$key = trim(CRM_Utils_Array::value('key', $_REQUEST));
- $docAdd = "More info at:" . CRM_Utils_System::docURL2("Managing Scheduled Jobs", TRUE, NULL, NULL, NULL, "wiki");
+ $docAdd = "More info at: " . CRM_Utils_System::docURL2('sysadmin/setup/jobs', TRUE);
if (!$key) {
return self::authenticateAbort(