link to cron.php broken when clean urls are disabled

Bart Jansens - August 17, 2008 - 09:16
Project:Drupal
Version:7.x-dev
Component:system.module
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed
Description

On the status report page, the link to cron.php doesn't work when clean urls are disabled. The link then points to something like http://localhost/~bart/drupal-7/?q=cron.php&cron_key=1bf726cd2d82b83ea03...

The same thing happens in the cron tests. It executes GET to http://localhost/~bart/drupal-7/?q=cron.php

The url is probably generated using l("cron.php") which happens to work when clean urls are enabled, but doesn't work when clean urls are disabled.

#1

swentel - August 17, 2008 - 11:33
Status:active» needs work

Can reproduce. Using external = true seems to help a bit. Attached is a patch which fixes the problem and tests pass now, however, I'm not sure if this is the way to go, so a good review is necessary I think :)

AttachmentSizeStatusTest resultOperations
cron.patch1.97 KBIgnoredNoneNone

#2

keith.smith - August 19, 2008 - 14:40

This bug is certainly confirmed (I haven't tried it with clean urls on), but it is certainly broken with clean urls off. I'll review the proposed patch a bit later.

#3

keith.smith - August 19, 2008 - 15:06

As an additional comment, the 'outside' cron link as it is currently coded does work properly with clean urls turned on.

#4

maartenvg - September 9, 2008 - 07:09
Status:needs work» needs review

Tested patch, applies cleanly, and solves the problem of failing cron-tests when clean urls are disabled, and continuous to pass when clean urls are enabled.

I think this a good and clean solution, as the alternative is worse and because we're dealing with an outlier. The alternative being: determining in url() whether the call is to cron.php (or some other existing file being: update.php, install.php and perhaps xmlrpc.php), and automatically assign $external = TRUE. This unnecessarily adds strain to an important function, to make life easier for only a few instances where it would fail.

Besides, we already work around this 'bug' in url(), for example the link to 'update.php' on the module listing page is created by means of $base_url . '/update.php', without using url().

Therefore, I'm for this patch, in this form. As a result I set this to CNR.

#5

mfb - September 17, 2008 - 07:06
Component:base system» system.module

Patch in #1 did not work for sites in a subdirectory.

AttachmentSizeStatusTest resultOperations
system-cron.patch2.6 KBIgnoredNoneNone

#6

pwolanin - October 12, 2008 - 23:11
Status:needs review» needs work

patch in #5 fails to apply.

#7

pwolanin - October 12, 2008 - 23:17
Status:needs work» reviewed & tested by the community

simple re-roll (maybe was just a whitespace change). Fixes tests and the status page.

AttachmentSizeStatusTest resultOperations
system-cron-296321-7.patch2.81 KBIgnoredNoneNone

#8

Dries - October 13, 2008 - 20:29
Status:reviewed & tested by the community» fixed

Committed to CVS HEAD. Thanks.

#9

Anonymous (not verified) - October 27, 2008 - 20:34
Status:fixed» closed

Automatically closed -- issue fixed for two weeks with no activity.

 
 

Drupal is a registered trademark of Dries Buytaert.