Skip to content

Commit

Permalink
Merge pull request #14085 from totten/master-cron-doc
Browse files Browse the repository at this point in the history
Cron Status Check - Better hyperlinks
  • Loading branch information
colemanw authored Apr 19, 2019
2 parents 8059238 + 6f0dbc2 commit d709040
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
9 changes: 4 additions & 5 deletions CRM/Utils/Check/Component/Env.php
Original file line number Diff line number Diff line change
Expand Up @@ -303,18 +303,17 @@ public function checkLastCron() {
);
}
else {
$cronLink = 'target="_blank" href="' . htmlentities(CRM_Utils_System::docURL2('sysadmin/setup/jobs/', TRUE)) . '""';
$msg .= '<p>' . ts('To enable scheduling support, please <a %1>set up the cron job</a>.', [
1 => $cronLink,
]) . '</p>';
$message = new CRM_Utils_Check_Message(
__FUNCTION__,
$msg,
ts('Cron Not Running'),
($lastCron > gmdate('U') - 86400) ? \Psr\Log\LogLevel::WARNING : \Psr\Log\LogLevel::ERROR,
'fa-clock-o'
);
$docUrl = 'target="_blank" href="' . CRM_Utils_System::docURL(['resource' => 'wiki', 'page' => 'Managing Scheduled Jobs', 'URLonly' => TRUE]) . '""';
$message->addHelp(
ts('Configuring cron on your server is necessary for running scheduled jobs such as sending mail and scheduled reminders.') . '<br />' .
ts("Learn more in the <a %1>online documentation</a>.", [1 => $docUrl])
);
$messages[] = $message;
}

Expand Down
2 changes: 1 addition & 1 deletion CRM/Utils/System.php
Original file line number Diff line number Diff line change
Expand Up @@ -1385,7 +1385,7 @@ public static function docURL($params) {
* @return mixed
*/
public static function formatDocUrl($url) {
return preg_replace('#^user/#', 'user/en/stable/', $url);
return preg_replace('#^(user|sysadmin|dev)/#', '\1/en/stable/', $url);
}

/**
Expand Down

0 comments on commit d709040

Please sign in to comment.