Much like the existing exception in hook_init(), globalredirect should not "process" a request when it is invoked from the command line via Drush (or even always when invoked from the command line), since redirecting simply terminates script execution. WIll try to come up with a solution to this issue.

CommentFileSizeAuthor
#1 594326-cli.patch970 bytessmk-ka

Comments

smk-ka’s picture

Status: Active » Needs review
StatusFileSize
new970 bytes

Patch. Note that php_get_sapi() is not reliable enough to determine whether or not PHP was executed from the command line. $_SERVER['SERVER_ADDR'], on the other hand, will always be set if executed by a webserver.

fuerst’s picture

Status: Needs review » Reviewed & tested by the community

Works well, thanks.
Same is true for the path_redirect Modul. See the issue there: #616772: hook_init() breaks drush

dave reid’s picture

I don't get why this applies to path_redirect as well. It should only redirect on certain conditions, whereas global_redirect in most cases is 'always' redirecting by design.

dave reid’s picture

Status: Reviewed & tested by the community » Fixed

Fixed in CVS for 7.x-1.x and 6.x-1.x! Thanks!
http://drupal.org/cvs?commit=336590
http://drupal.org/cvs?commit=336592

Status: Fixed » Closed (fixed)

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