diff --git a/includes/ajax.inc b/includes/ajax.inc index 6584451..88249ab 100644 --- a/includes/ajax.inc +++ b/includes/ajax.inc @@ -46,9 +46,12 @@ function views_ajax() { $_GET['q'] = $path; } - // Add all $_POST data, because AJAX is always a post and many things, + // If page parameter is in the $_POST exclude it from $_GET, + // otherwise support views_ajax requests using $_GET. + $exclude = isset($_POST['page']) ? array('page') : array(); + // Add all $_POST data to $_GET as many things, // such as tablesorts, exposed filters and paging assume $_GET. - $_GET = $_POST + drupal_get_query_parameters($_GET, array('page')); + $_GET = $_POST + drupal_get_query_parameters($_GET, $exclude); // Overwrite the destination. // @see drupal_get_destination()