? 361150-path_redirect-preserve-querystring.patch
Index: path_redirect.admin.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/path_redirect/path_redirect.admin.inc,v
retrieving revision 1.1.2.82
diff -u -p -r1.1.2.82 path_redirect.admin.inc
--- path_redirect.admin.inc	1 Mar 2010 20:50:04 -0000	1.1.2.82
+++ path_redirect.admin.inc	30 Jul 2010 16:24:38 -0000
@@ -508,6 +508,13 @@ function path_redirect_settings_form() {
     '#title' => t('Allow users to bypass redirects by adding %code to the URL.', array('%code' => variable_get('clean_url', 0) ? '?redirect=no' : '&redirect=no')),
     '#default_value' => variable_get('path_redirect_allow_bypass', 0),
   );
+  $form['path_redirect_retain_query_string'] = array(
+    '#type' => 'checkbox',
+    '#title' => t('Include incoming URL query string in redirect'),
+    '#default_value' => variable_get('path_redirect_retain_query_string', FALSE),
+    '#description' => t("Allow query strings on the source URL to carry forward to the redirected URL. If enabled, the query string on an incoming URL is merged with the query string stored with the redirect URL if any (query string components from the incoming URL will be overwritten by saved values)."),
+  );
+
   $form['path_redirect_auto_redirect'] = array(
     '#type' => 'checkbox',
     '#title' => t('Automatically create redirects when URL aliases are changed.'),
Index: path_redirect.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/path_redirect/path_redirect.module,v
retrieving revision 1.3.2.7.2.97
diff -u -p -r1.3.2.7.2.97 path_redirect.module
--- path_redirect.module	18 Mar 2010 15:20:27 -0000	1.3.2.7.2.97
+++ path_redirect.module	30 Jul 2010 16:24:39 -0000
@@ -111,6 +111,11 @@ function path_redirect_goto($redirect = 
   }
 
   if ($redirect) {
+    if (variable_get('path_redirect_retain_query_string', FALSE)) {
+      // Append to query string on redirect URL
+      // Values from the stored redirect will override those specified in the request if they collide.
+      $redirect['query'] = array_merge($query, $redirect['query']);
+    }
     // Create the absolute redirection URL.
     $redirect['redirect_url'] = url($redirect['redirect'], array('query' => $redirect['query'], 'fragment' => $redirect['fragment'], 'absolute' => TRUE));
 
@@ -573,6 +578,7 @@ function path_redirect_get_query_array($
 
 function path_redirect_variables() {
   return array(
+    'path_redirect_retain_query_string' => FALSE,
     'path_redirect_redirect_warning' => 0,
     'path_redirect_allow_bypass' => 0,
     'path_redirect_auto_redirect' => 1,
