Project:Path redirect
Version:6.x-1.0-beta4
Component:Code
Category:support request
Priority:normal
Assigned:Unassigned
Status:closed (fixed)

Issue Summary

As described in #594326: Breaks Drush for the module Global Redirect a redirection breaks the execution of the drush shell command. The fix it to return from path_redirect_init() without calling _path_redirect_check() when executing path_redirect_init() through drush.

Comments

#1

The attached patch simply is adapting the patch from #594326: Breaks Drush to this module.

AttachmentSizeStatusTest resultOperations
path_redirect-616772.patch531 bytesIgnored: Check issue status.NoneNone

#2

Status:active» postponed (maintainer needs more info)

Why would a redirect be executed by Path redirect? I can understand Global redirect since it 'works' for basically all requests, but path redirect should only happen on specific paths. Did you actually test that this doesn't work with Drush? Can you give insight into the conditions leading to failure?

#3

When executing drush update at the command line the $r object inside _path_redirect_check() will be populated by this values:

stdClass Object
(
    [rid] => 24
    [path] => home/home
    [redirect] => node/5
    [query] =>
    [fragment] =>
    [language] =>
    [type] => 301
    [last_used] => 1256747530
)

The $_GET variable has this content:

Array
(
    [q] => home/home
)

At my site there exists a path redirect for home/home which is configured as front page in /admin/settings/site-information. If I delete that redirection or set the front page configuration to another non-redirected URL like node/5 the error does not occur.

Looks like drush always calls the front page of Drupal. If the front page is set to a path redirect a redirection will be triggered which in turn breaks Drush.

So the solution to not redirect when called by Drush looks good to me. What do you think?

#4

In this case, you should be using global redirect and not using path_redirect.

#5

Path Redirect will be used by the Pathauto module. So the redirect in question is not configured by me but setup automatically by Pathauto. Looks like a unfortunate condition which is surely not the fault of Path Redirect. May be it can be fixed in Drush itself. Will get back to the issue queue there.

#6

Category:bug report» support request
Status:postponed (maintainer needs more info)» fixed

Marking this issue as fixed due to lack of response.

#7

Status:fixed» closed (fixed)

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

nobody click here