Commit 06c52f42 authored by Mike Keran's avatar Mike Keran
Browse files

Issue #2179169 by pamatt, jim_keller, justindodge, jamesgrobertson,...

Issue #2179169 by pamatt, jim_keller, justindodge, jamesgrobertson, pmchristensen, sweetprincess, mikeker: exposed blocks path incorrect when using bef_links + contextual filters or Content Pane displays
parent c6fd0160
......@@ -752,9 +752,10 @@ function bef_replace_query_string_arg($key, $value, $multiple = FALSE, $remove =
$query[$key] = $value;
}
}
// Unset page arg so we don't land on an empty page off the end of the newly filtered listing
// Unset page arg so we don't land on an empty page off the end of the newly
// filtered listing.
unset($query['page']);
return url($path, array(
return url(ltrim($path, '/'), array(
'query' => $query,
'fragment' => $fragment,
'absolute' => TRUE,
......
......@@ -791,6 +791,9 @@ dateFormat: "dd-mm-yy"
$context['display'] = $this->display;
drupal_alter('better_exposed_filters_settings', $settings, $context);
// Adds view's arguments (if any) to the path to be used use for #bef_path.
$view_path = $this->view->args ? implode('/', array_merge(array($this->view->get_path()), $this->view->args)) : $this->view->get_path();
// Some elements may be placed in a secondary fieldset (eg: "Advanced
// search options"). Place this after the exposed filters and before the
// rest of the items in the exposed form.
......@@ -941,7 +944,7 @@ dateFormat: "dd-mm-yy"
// select_as_links options as they will use the wrong path. We
// provide a hint for theme functions to correct this.
if (!empty($this->display->display_options['exposed_block'])) {
$form[$settings['sort']['advanced']['combine_param']]['#bef_path'] = $this->view->get_path();
$form[$settings['sort']['advanced']['combine_param']]['#bef_path'] = $view_path;
}
break;
......@@ -995,7 +998,7 @@ dateFormat: "dd-mm-yy"
// select_as_links options as they will use the wrong path. We provide
// a hint for theme functions to correct this.
if (!empty($this->display->display_options['exposed_block'])) {
$form['sort_by']['#bef_path'] = $form['sort_order']['#bef_path'] = $this->view->get_path();
$form['sort_by']['#bef_path'] = $form['sort_order']['#bef_path'] = $view_path;
}
}
......@@ -1044,7 +1047,7 @@ dateFormat: "dd-mm-yy"
// select_as_links options as they will use the wrong path. We
// provide a hint for theme functions to correct this.
if (!empty($this->display->display_options['exposed_block'])) {
$form['sort_by']['#bef_path'] = $this->display->display_options['path'];
$form['sort_by']['#bef_path'] = $view_path;
}
}
}
......@@ -1077,7 +1080,7 @@ dateFormat: "dd-mm-yy"
// select_as_links options as they will use the wrong path. We
// provide a hint for theme functions to correct this.
if (!empty($this->display->display_options['exposed_block'])) {
$form['items_per_page']['#bef_path'] = $this->view->get_path();
$form['items_per_page']['#bef_path'] = $view_path;
}
}
break;
......@@ -1426,7 +1429,7 @@ dateFormat: "dd-mm-yy"
// select_as_links options as they will use the wrong path. We provide
// a hint for theme functions to correct this.
if (!empty($this->display->display_options['exposed_block'])) {
$form[$filter_id]['#bef_path'] = $this->view->get_path();
$form[$filter_id]['#bef_path'] = $view_path;
}
break;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment