From f7e61d77e96b1f67b1ea58273a0cfc8020715f65 Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Mon, 13 Oct 2008 20:29:42 +0000 Subject: - Patch #296321 by pwolanin, swentel: link to cron.php broken when clean URLs are disabled. --- modules/system/system.install | 3 ++- modules/system/system.test | 7 ++++--- 2 files changed, 6 insertions(+), 4 deletions(-) (limited to 'modules') diff --git a/modules/system/system.install b/modules/system/system.install index 28834f8a3..dbd6c8f29 100644 --- a/modules/system/system.install +++ b/modules/system/system.install @@ -10,6 +10,7 @@ * An array of system requirements. */ function system_requirements($phase) { + global $base_url; $requirements = array(); // Ensure translations don't break at install time $t = get_t(); @@ -171,7 +172,7 @@ function system_requirements($phase) { } $description .= ' ' . $t('You can run cron manually.', array('@cron' => url('admin/reports/status/run-cron'))); - $description .= '
' . $t('To run cron from outside the site, go to !cron', array('!cron' => url('cron.php', array('absolute' => TRUE, 'query' => 'cron_key=' . variable_get('cron_key', 'drupal'))))); + $description .= '
' . $t('To run cron from outside the site, go to !cron', array('!cron' => url($base_url . '/cron.php', array('external' => TRUE, 'query' => 'cron_key=' . variable_get('cron_key', 'drupal'))))); $requirements['cron'] = array( 'title' => $t('Cron maintenance tasks'), diff --git a/modules/system/system.test b/modules/system/system.test index 8934316ac..2aa7c9a7e 100644 --- a/modules/system/system.test +++ b/modules/system/system.test @@ -234,18 +234,19 @@ class CronRunTestCase extends DrupalWebTestCase { * Test cron runs. */ function testCronRun() { + global $base_url; // Run cron anonymously without any cron key. - $this->drupalGet('cron.php'); + $this->drupalGet($base_url . '/cron.php', array('external' => TRUE)); $this->assertResponse(403); // Run cron anonymously with a random cron key. $key = $this->randomName(16); - $this->drupalGet('cron.php', array('query' => 'cron_key=' . $key)); + $this->drupalGet($base_url . '/cron.php', array('external' => TRUE, 'query' => 'cron_key=' . $key)); $this->assertResponse(403); // Run cron anonymously with the valid cron key. $key = variable_get('cron_key', 'drupal'); - $this->drupalGet('cron.php', array('query' => 'cron_key=' . $key)); + $this->drupalGet($base_url . '/cron.php', array('external' => TRUE, 'query' => 'cron_key=' . $key)); $this->assertResponse(200); // Execute cron directly. -- cgit v1.2.3