diff options
author | Dries Buytaert <dries@buytaert.net> | 2008-11-05 14:28:04 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2008-11-05 14:28:04 +0000 |
commit | 9a0618b98f0befd74a2230548f7bb837093eeb84 (patch) | |
tree | d0bfeab767a6265921a59304f17446ab73e45a44 | |
parent | 54a03ca95d36644eef18fd827e47206066a78f5f (diff) | |
download | brdo-9a0618b98f0befd74a2230548f7bb837093eeb84.tar.gz brdo-9a0618b98f0befd74a2230548f7bb837093eeb84.tar.bz2 |
- Patch #93509 by catch: automatically run cron after installation, improve the cron notifications.
-rw-r--r-- | install.php | 5 | ||||
-rw-r--r-- | modules/system/system.install | 28 |
2 files changed, 11 insertions, 22 deletions
diff --git a/install.php b/install.php index cd7ee8d2a..caa5feb3e 100644 --- a/install.php +++ b/install.php @@ -835,6 +835,11 @@ if (Drupal.jsEnabled) { install_task_list($task); variable_set('install_task', $task); + // Run cron to populate update status tables (if available) so that users + // will be warned if they've installed an out of date Drupal version. + // Will also trigger indexing of profile-supplied content or feeds. + drupal_cron_run(); + // Output page, if some output was required. Otherwise it is possible // that we are printing a JSON page and theme output should not be there. if (isset($output)) { diff --git a/modules/system/system.install b/modules/system/system.install index 58f5e1f3d..4472c5a68 100644 --- a/modules/system/system.install +++ b/modules/system/system.install @@ -133,12 +133,9 @@ function system_requirements($phase) { // Cron configuration help text. $help = $t('For more information, see the online handbook entry for <a href="@cron-handbook">configuring cron jobs</a>.', array('@cron-handbook' => 'http://drupal.org/cron')); - // Determine when cron last ran. If never, use the install time to - // determine the warning or error status. + // Determine when cron last ran. $cron_last = variable_get('cron_last', NULL); - $never_run = FALSE; if (!is_numeric($cron_last)) { - $never_run = TRUE; $cron_last = variable_get('install_time', 0); } @@ -147,28 +144,15 @@ function system_requirements($phase) { if (REQUEST_TIME - $cron_last > $threshold_error) { $severity = REQUIREMENT_ERROR; } - elseif ($never_run || (REQUEST_TIME - $cron_last > $threshold_warning)) { + elseif (REQUEST_TIME - $cron_last > $threshold_warning) { $severity = REQUIREMENT_WARNING; } - // If cron hasn't been run, and the user is viewing the main - // administration page, instead of an error, we display a helpful reminder - // to configure cron jobs. - if ($never_run && $severity != REQUIREMENT_ERROR && $_GET['q'] == 'admin' && user_access('administer site configuration')) { - drupal_set_message($t('Cron has not run. Please visit the <a href="@status">status report</a> for more information.', array('@status' => url('admin/reports/status')))); - } - // Set summary and description based on values determined above. - if ($never_run) { - $summary = $t('Never run'); - $description = $t('Cron has not run.') . ' ' . $help; - } - else { - $summary = $t('Last run !time ago', array('!time' => format_interval(REQUEST_TIME - $cron_last))); - $description = ''; - if ($severity != REQUIREMENT_OK) { - $description = $t('Cron has not run recently.') . ' ' . $help; - } + $summary = $t('Last run !time ago', array('!time' => format_interval(REQUEST_TIME - $cron_last))); + $description = ''; + if ($severity != REQUIREMENT_OK) { + $description = $t('Cron has not run recently.') . ' ' . $help; } $description .= ' ' . $t('You can <a href="@cron">run cron manually</a>.', array('@cron' => url('admin/reports/status/run-cron'))); |