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

markpavlitski’s picture

Version: 7.x-1.5 » 7.x-1.x-dev
Status: Active » Fixed

Thanks 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.

Status: Fixed » Closed (fixed)

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