Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Hi,
Problem
We had issues with cron not being properly executed after the push of global_redirect to our production environment. When calling cron.php with it's cron_key we were redirected to the frontpage with a 301 redirect.
In globalredirect_init() the following code was executed where $request_path has 'cron.php' has value and $prefix was empty.
if ($request_path != $prefix) {
drupal_goto('', $options, 301);
}
Proposed resolution
We fixed this problem by adding a specific check from cron.php script :
if ($request_path == 'cron.php') {
// No redirect should be done on cron execution.
return;
}
right after the following statement :
// Get the request path. We cannot use request_path() as it uses a completely trimmed path.
// We need just left trimmed.
$request_path = globalredirect_request_path();
Hope it helps.
Regards,
Seb
Comments
Comment #1
markpavlitski CreditAttribution: markpavlitski commentedThanks for reporting this issue and for the suggested fix.
This has been fixed in the latest 7.x dev release now, by checking for index.php and not redirecting otherwise.