Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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(
Comment | File | Size | Author |
---|---|---|---|
#2 | stop-stripping-destination-parameter-1477200-2.patch | 936 bytes | Devin Carlson |
Comments
Comment #1
emilymoi CreditAttribution: emilymoi commentedHave been using my patch above for 2 months without problems.
Comment #2
Devin Carlson CreditAttribution: Devin Carlson commentedA patch to implement the change outlined in the original issue. I've also been using this without issue.
Comment #3
mathieso CreditAttribution: mathieso commentedPatch works! Hooray!!!!!
Comment #4
DamienMcKennaMaybe we should run the testbot first?
Comment #5
DamienMcKennaComment #6
DamienMcKennaComment #7
david_garcia CreditAttribution: david_garcia commented+1 RTBC
Comment #8
david_garcia CreditAttribution: david_garcia commentedComment #9
SocialNicheGuru CreditAttribution: SocialNicheGuru commentedComment #10
maxplus CreditAttribution: maxplus commented#2 works great for me, Thanks!
Comment #11
BarisW CreditAttribution: BarisW at LimoenGroen commentedLooks good. Thanks a lot!
Comment #13
BarisW CreditAttribution: BarisW at LimoenGroen commentedCommitted to 7.x-1.x-dev