I have a hard time believing I am the only one experiencing this but I cannot see any other reports.

If I trigger a global redirect and include a destination parameter, that destination parameter gets lost.

Example:

http://mysite.com/node/18/edit?destination=somewhere

Results in:

http://mysite.com/some_alias (the destination is blown away)

I managed to fix my problem by moving the destination unset code below the $query_string building.

--- globalredirect.module.old	2012-03-10 20:03:31.227616000 -0400
+++ globalredirect.module	2012-03-10 19:57:11.803616001 -0400
@@ -43,6 +43,12 @@
     }
   }
 
+  // Get the query string parameters. If none set, set to NULL
+  $query_string = drupal_get_query_parameters();
+  if (empty($query_string)) {
+    $query_string = NULL;
+  }
+  
   // Store the destination from the $_GET as, if we leave it in, drupal_goto()
   // will go to that instead.
   if (isset($_GET['destination'])) {
@@ -50,12 +56,6 @@
     unset($_GET['destination']);
   }
 
-  // Get the query string parameters. If none set, set to NULL
-  $query_string = drupal_get_query_parameters();
-  if (empty($query_string)) {
-    $query_string = NULL;
-  }
-
   // Establish the language prefix that should be used, ie. the one that
   // drupal_goto() would use
   $options = array(
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

emilymoi’s picture

Title: The redirection parameter gets blown away » The destination parameter gets blown away
Status: Active » Needs review

Have been using my patch above for 2 months without problems.

Devin Carlson’s picture

Version: 7.x-1.4 » 7.x-1.x-dev
Assigned: Unassigned » Devin Carlson
Priority: Normal » Major
Status: Needs review » Reviewed & tested by the community
FileSize
936 bytes

A patch to implement the change outlined in the original issue. I've also been using this without issue.

mathieso’s picture

Issue summary: View changes

Patch works! Hooray!!!!!

DamienMcKenna’s picture

Status: Reviewed & tested by the community » Needs review

Maybe we should run the testbot first?

DamienMcKenna’s picture

Status: Needs review » Reviewed & tested by the community
DamienMcKenna’s picture

Assigned: Devin Carlson » Unassigned
david_garcia’s picture

+1 RTBC

david_garcia’s picture

SocialNicheGuru’s picture

maxplus’s picture

#2 works great for me, Thanks!

BarisW’s picture

Looks good. Thanks a lot!

  • BarisW committed 5752c13 on 7.x-1.x authored by Devin Carlson
    Issue #1477200 by Devin Carlson, DamienMcKenna, bfcam, david_garcia,...
BarisW’s picture

Status: Reviewed & tested by the community » Fixed

Committed to 7.x-1.x-dev

Status: Fixed » Closed (fixed)

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