diff --git a/better_exposed_filters.theme b/better_exposed_filters.theme index 8b59d99..9635a01 100644 --- a/better_exposed_filters.theme +++ b/better_exposed_filters.theme @@ -678,7 +678,7 @@ function bef_replace_query_string_arg($key, $value, $multiple = FALSE, $remove = if (!$path) { $path = implode('/', arg()); } - + // Prevents us from having to check for each index from parse_url that we may // use. $urllist = array('path' => '', 'fragment' => '', 'query' => ''); @@ -704,7 +704,7 @@ function bef_replace_query_string_arg($key, $value, $multiple = FALSE, $remove = $query[$key] = $value; } } - return url($path, array( + return url(ltrim($path, '/'), array( 'query' => $query, 'fragment' => $fragment, 'absolute' => TRUE, diff --git a/better_exposed_filters_exposed_form_plugin.inc b/better_exposed_filters_exposed_form_plugin.inc index 69b38c2..7a1ba72 100644 --- a/better_exposed_filters_exposed_form_plugin.inc +++ b/better_exposed_filters_exposed_form_plugin.inc @@ -699,7 +699,7 @@ Title Desc|Z -> A Leave the replacement value blank to remove an option al // 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_bef_combine']['#bef_path'] = $this->display->display_options['path']; + $form['sort_bef_combine']['#bef_path'] = $form['#action']; } break; @@ -753,8 +753,8 @@ Title Desc|Z -> A Leave the replacement value blank to remove an option al // 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_order']['#bef_path'] = $this->display->display_options['path']; + $form['sort_by']['#bef_path'] = $form['#action']; + $form['sort_order']['#bef_path'] = $form['#action']; } } @@ -822,7 +822,7 @@ Title Desc|Z -> A Leave the replacement value blank to remove an option al // 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->display->display_options['path']; + $form['items_per_page']['#bef_path'] = $form['#action']; } } break; @@ -1113,7 +1113,7 @@ Title Desc|Z -> A Leave the replacement value blank to remove an option al // 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[$field_id]['#bef_path'] = $this->display->display_options['path']; + $form[$field_id]['#bef_path'] = $form['#action']; } break;