Breaks Drush

smk-ka - October 2, 2009 - 16:11
Project:Global Redirect
Version:6.x-1.x-dev
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:reviewed & tested by the community
Description

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.

#1

smk-ka - October 2, 2009 - 16:36
Status:active» needs review

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.

AttachmentSize
594326-cli.patch 970 bytes

#2

fuerst - October 28, 2009 - 10:45
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

#3

Dave Reid - October 28, 2009 - 16:34

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.

 
 

Drupal is a registered trademark of Dries Buytaert.