diff --git a/includes/ajax.inc b/includes/ajax.inc index cd63360..701185e 100644 --- a/includes/ajax.inc +++ b/includes/ajax.inc @@ -50,12 +50,17 @@ function views_ajax() { // such as tablesorts, exposed filters and paging assume $_GET. $_GET = $_POST + $_GET; - // Overwrite the destination. + // Overwrite the destination. On AJAX requests $_GET['q'] is set to + // 'views/ajax' so we actively unset this to ensure we just get the actual + // query parameters. + // // @see drupal_get_destination() $origin_destination = $path; - $query = drupal_http_build_query($_REQUEST); - if ($query != '') { - $origin_destination .= '?' . $query; + $query = $_REQUEST; + unset($query['q']); + $query_string = drupal_http_build_query($query); + if ($query_string != '') { + $origin_destination .= '?' . $query_string; } $destination = &drupal_static('drupal_get_destination'); $destination = array('destination' => $origin_destination);