Commit 5259e3b9 authored by webchick's avatar webchick

Issue #2409209 by dawehner, xjm, mpdonadio, Wim Leers, hussainweb,...

Issue #2409209 by dawehner, xjm, mpdonadio, Wim Leers, hussainweb, RavindraSingh, prashantgoel: Replace all _url() calls beside the one in _l()
parent 1c38d70a
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
use Drupal\Component\Utility\String; use Drupal\Component\Utility\String;
use Drupal\Core\Form\FormBase; use Drupal\Core\Form\FormBase;
use Drupal\Core\Form\FormStateInterface; use Drupal\Core\Form\FormStateInterface;
use Drupal\Core\Url;
use Drupal\views\ExposedFormCache; use Drupal\views\ExposedFormCache;
use Symfony\Component\DependencyInjection\ContainerInterface; use Symfony\Component\DependencyInjection\ContainerInterface;
...@@ -115,7 +116,7 @@ public function buildForm(array $form, FormStateInterface $form_state) { ...@@ -115,7 +116,7 @@ public function buildForm(array $form, FormStateInterface $form_state) {
'#id' => drupal_html_id('edit-submit-' . $view->storage->id()), '#id' => drupal_html_id('edit-submit-' . $view->storage->id()),
); );
$form['#action'] = _url($view->display_handler->getUrl()); $form['#action'] = $view->hasUrl() ? $view->getUrl()->toString() : Url::fromRoute('<current>')->toString();
$form['#theme'] = $view->buildThemeFunctions('views_exposed_form'); $form['#theme'] = $view->buildThemeFunctions('views_exposed_form');
$form['#id'] = Html::cleanCssIdentifier('views_exposed_form-' . String::checkPlain($view->storage->id()) . '-' . String::checkPlain($display['id'])); $form['#id'] = Html::cleanCssIdentifier('views_exposed_form-' . String::checkPlain($view->storage->id()) . '-' . String::checkPlain($display['id']));
......
...@@ -133,7 +133,8 @@ public function buildForm(array $form, FormStateInterface $form_state, ViewExecu ...@@ -133,7 +133,8 @@ public function buildForm(array $form, FormStateInterface $form_state, ViewExecu
$query = $this->requestStack->getCurrentRequest()->query->all(); $query = $this->requestStack->getCurrentRequest()->query->all();
$query = UrlHelper::filterQueryParameters($query, array(), ''); $query = UrlHelper::filterQueryParameters($query, array(), '');
$form['#action'] = $this->urlGenerator->generateFromPath($view->getUrl(), array('query' => $query)); $options = array('query' => $query);
$form['#action'] = $view->hasUrl() ? $view->getUrl()->setOptions($options)->toString() : Url::fromRoute('<current>')->setOptions($options)->toString();
// Tell the preprocessor whether it should hide the header, footer, pager... // Tell the preprocessor whether it should hide the header, footer, pager...
$form['show_view_elements'] = array( $form['show_view_elements'] = array(
'#type' => 'value', '#type' => 'value',
......
...@@ -723,11 +723,31 @@ public function getPath() { ...@@ -723,11 +723,31 @@ public function getPath() {
} }
} }
/**
* {@inheritdoc}
*/
public function getRoutedDisplay() {
// If this display has a route, return this display.
if ($this instanceof DisplayRouterInterface) {
return $this;
}
// If the display does not have a route (e.g. a block display), get the
// route for the linked display.
$display_id = $this->getLinkDisplay();
if ($display_id && $this->view->displayHandlers->has($display_id) && is_object($this->view->displayHandlers->get($display_id))) {
return $this->view->displayHandlers->get($display_id)->getRoutedDisplay();
}
// No routed display exists, so return NULL
return NULL;
}
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
public function getUrl() { public function getUrl() {
return $this->view->getUrl(); return $this->view->getUrl(NULL, $this->display['id']);
} }
/** /**
...@@ -1973,27 +1993,31 @@ public function renderPager() { ...@@ -1973,27 +1993,31 @@ public function renderPager() {
*/ */
public function renderMoreLink() { public function renderMoreLink() {
if ($this->isMoreEnabled() && ($this->useMoreAlways() || (!empty($this->view->pager) && $this->view->pager->hasMoreRecords()))) { if ($this->isMoreEnabled() && ($this->useMoreAlways() || (!empty($this->view->pager) && $this->view->pager->hasMoreRecords()))) {
$path = $this->getPath(); // If the user has supplied a custom "More" link path, replace any
// argument tokens and use that for the URL.
if ($this->getOption('link_display') == 'custom_url' && $override_path = $this->getOption('link_url')) { if ($this->getOption('link_display') == 'custom_url' && $override_path = $this->getOption('link_url')) {
$tokens = $this->getArgumentsTokens(); $tokens = $this->getArgumentsTokens();
$path = $this->viewsTokenReplace($override_path, $tokens); $path = $this->viewsTokenReplace($override_path, $tokens);
$url = Url::fromUri('user-path:/' . $path);
}
// Otherwise, use the URL for the display.
else {
$url = $this->view->getUrl(NULL, $this->display['id']);
} }
if ($path) { // If a URL is available (either from the display or a custom path),
if (empty($override_path)) { // render the "More" link.
$path = $this->view->getUrl(NULL, $path); if ($url) {
}
$url_options = array(); $url_options = array();
if (!empty($this->view->exposed_raw_input)) { if (!empty($this->view->exposed_raw_input)) {
$url_options['query'] = $this->view->exposed_raw_input; $url_options['query'] = $this->view->exposed_raw_input;
} }
$url->setOptions($url_options);
$theme = $this->view->buildThemeFunctions('views_more'); $theme = $this->view->buildThemeFunctions('views_more');
$path = check_url(_url($path, $url_options));
return array( return array(
'#theme' => $theme, '#theme' => $theme,
'#more_url' => $path, '#more_url' => $url->toString(),
'#link_text' => String::checkPlain($this->useMoreText()), '#link_text' => String::checkPlain($this->useMoreText()),
'#view' => $this->view, '#view' => $this->view,
); );
......
...@@ -213,6 +213,23 @@ public function getLinkDisplay(); ...@@ -213,6 +213,23 @@ public function getLinkDisplay();
*/ */
public function getPath(); public function getPath();
/**
* Points to the display which can be linked by this display.
*
* If the display has route information, the display itself is returned.
* Otherwise, the configured linked display is returned. For example, if a
* block display links to a page display, the page display will be returned
* in both cases.
*
* @return \Drupal\views\Plugin\views\display\DisplayRouterInterface|NULL
*/
public function getRoutedDisplay();
/**
* Returns a URL to $this display or its configured linked display.
*
* @return \Drupal\Core\Url|null
*/
public function getUrl(); public function getUrl();
/** /**
......
...@@ -46,4 +46,29 @@ public function alterRoutes(RouteCollection $collection); ...@@ -46,4 +46,29 @@ public function alterRoutes(RouteCollection $collection);
*/ */
public function getUrlInfo(); public function getUrlInfo();
/**
* Returns the route name for the display.
*
* The default route name for a display is views.$view_id.$display_id. Some
* displays may override existing routes; in these cases, the route that is
* overridden is returned instead.
*
* @return string
* The name of the route
*
* @see \Drupal\views\Plugin\views\display\DisplayRouterInterface::alterRoutes()
* @see \Drupal\views\Plugin\views\display\DisplayRouterInterface::getAlteredRouteNames()
*/
public function getRouteName();
/**
* Returns the list of routes overridden by Views.
*
* @return string[]
* An array of overridden route names. The keys are in the form
* view_id.display_id and the values are the route names.
*
* @see \Drupal\views\Plugin\views\display\DisplayRouterInterface::alterRoutes()
*/
public function getAlteredRouteNames();
} }
...@@ -268,7 +268,7 @@ public function attachTo(ViewExecutable $clone, $display_id, array &$build) { ...@@ -268,7 +268,7 @@ public function attachTo(ViewExecutable $clone, $display_id, array &$build) {
$clone->setDisplay($this->display['id']); $clone->setDisplay($this->display['id']);
$clone->buildTitle(); $clone->buildTitle();
if ($plugin = $clone->display_handler->getPlugin('style')) { if ($plugin = $clone->display_handler->getPlugin('style')) {
$plugin->attachTo($build, $display_id, $this->getPath(), $clone->getTitle()); $plugin->attachTo($build, $display_id, $clone->getUrl(), $clone->getTitle());
foreach ($clone->feedIcons as $feed_icon) { foreach ($clone->feedIcons as $feed_icon) {
$this->view->feedIcons[] = $feed_icon; $this->view->feedIcons[] = $feed_icon;
} }
......
...@@ -294,8 +294,6 @@ public function getMenuLinks() { ...@@ -294,8 +294,6 @@ public function getMenuLinks() {
} }
} }
$view_route_names = $this->state->get('views.view_route_names') ?: array();
$path = implode('/', $bits); $path = implode('/', $bits);
$view_id = $this->view->storage->id(); $view_id = $this->view->storage->id();
$display_id = $this->display['id']; $display_id = $this->display['id'];
...@@ -309,7 +307,7 @@ public function getMenuLinks() { ...@@ -309,7 +307,7 @@ public function getMenuLinks() {
// Some views might override existing paths, so we have to set the route // Some views might override existing paths, so we have to set the route
// name based upon the altering. // name based upon the altering.
$links[$menu_link_id] = array( $links[$menu_link_id] = array(
'route_name' => isset($view_route_names[$view_id_display]) ? $view_route_names[$view_id_display] : "view.$view_id_display", 'route_name' => $this->getRouteName(),
// Identify URL embedded arguments and correlate them to a handler. // Identify URL embedded arguments and correlate them to a handler.
'load arguments' => array($this->view->storage->id(), $this->display['id'], '%index'), 'load arguments' => array($this->view->storage->id(), $this->display['id'], '%index'),
'id' => $menu_link_id, 'id' => $menu_link_id,
...@@ -490,11 +488,28 @@ public function validate() { ...@@ -490,11 +488,28 @@ public function validate() {
* {@inheritdoc} * {@inheritdoc}
*/ */
public function getUrlInfo() { public function getUrlInfo() {
if (strpos($this->getOption('path'), '%') !== FALSE) { return Url::fromRoute($this->getRouteName());
throw new \InvalidArgumentException('No placeholders supported yet.'); }
}
return Url::fromRoute($this->getRoute($this->view->storage->id(), $this->display['id'])); /**
* {@inheritdoc}
*/
public function getRouteName() {
$view_id = $this->view->storage->id();
$display_id = $this->display['id'];
$view_route_key = "$view_id.$display_id";
// Check for overridden route names.
$view_route_names = $this->getAlteredRouteNames();
return (isset($view_route_names[$view_route_key]) ? $view_route_names[$view_route_key] : "views.$view_route_key");
}
/**
* {@inheritdoc}
*/
public function getAlteredRouteNames() {
return $this->state->get('views.view_route_names') ?: array();
} }
} }
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
namespace Drupal\views\Plugin\views\row; namespace Drupal\views\Plugin\views\row;
use Drupal\Core\Form\FormStateInterface; use Drupal\Core\Form\FormStateInterface;
use Drupal\Core\Url;
/** /**
* Renders an RSS item based on fields. * Renders an RSS item based on fields.
...@@ -143,7 +144,7 @@ public function render($row) { ...@@ -143,7 +144,7 @@ public function render($row) {
// Create the RSS item object. // Create the RSS item object.
$item = new \stdClass(); $item = new \stdClass();
$item->title = $this->getField($row_index, $this->options['title_field']); $item->title = $this->getField($row_index, $this->options['title_field']);
$item->link = _url($this->getField($row_index, $this->options['link_field']), array('absolute' => TRUE)); $item->link = Url::fromUri('user-path:/' . $this->getField($row_index, $this->options['link_field']))->setAbsolute()->toString();
$item->description = $this->getField($row_index, $this->options['description_field']); $item->description = $this->getField($row_index, $this->options['description_field']);
$item->elements = array( $item->elements = array(
array('key' => 'pubDate', 'value' => $this->getField($row_index, $this->options['date_field'])), array('key' => 'pubDate', 'value' => $this->getField($row_index, $this->options['date_field'])),
...@@ -157,7 +158,7 @@ public function render($row) { ...@@ -157,7 +158,7 @@ public function render($row) {
$item_guid = $this->getField($row_index, $this->options['guid_field_options']['guid_field']); $item_guid = $this->getField($row_index, $this->options['guid_field_options']['guid_field']);
if ($this->options['guid_field_options']['guid_field_is_permalink']) { if ($this->options['guid_field_options']['guid_field_is_permalink']) {
$guid_is_permalink_string = 'true'; $guid_is_permalink_string = 'true';
$item_guid = _url($item_guid, array('absolute' => TRUE)); $item_guid = Url::fromUri('user-path:/' . $item_guid)->setAbsolute()->toString();
} }
$item->elements[] = array( $item->elements[] = array(
'key' => 'guid', 'key' => 'guid',
......
...@@ -7,6 +7,8 @@ ...@@ -7,6 +7,8 @@
namespace Drupal\views\Plugin\views\style; namespace Drupal\views\Plugin\views\style;
use Drupal\Core\Url;
/** /**
* Default style plugin to render an OPML feed. * Default style plugin to render an OPML feed.
* *
...@@ -32,7 +34,7 @@ class Opml extends StylePluginBase { ...@@ -32,7 +34,7 @@ class Opml extends StylePluginBase {
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
public function attachTo(array &$build, $display_id, $path, $title) { public function attachTo(array &$build, $display_id, Url $feed_url, $title) {
$display = $this->view->displayHandlers->get($display_id); $display = $this->view->displayHandlers->get($display_id);
$url_options = array(); $url_options = array();
$input = $this->view->getExposedInput(); $input = $this->view->getExposedInput();
...@@ -41,7 +43,7 @@ public function attachTo(array &$build, $display_id, $path, $title) { ...@@ -41,7 +43,7 @@ public function attachTo(array &$build, $display_id, $path, $title) {
} }
$url_options['absolute'] = TRUE; $url_options['absolute'] = TRUE;
$url = _url($this->view->getUrl(NULL, $path), $url_options); $url = $feed_url->setOptions($url_options)->toString();
if ($display->hasPath()) { if ($display->hasPath()) {
if (empty($this->preview)) { if (empty($this->preview)) {
$build['#attached']['feed'][] = array($url, $title); $build['#attached']['feed'][] = array($url, $title);
......
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
use Drupal\Component\Utility\SafeMarkup; use Drupal\Component\Utility\SafeMarkup;
use Drupal\Core\Form\FormStateInterface; use Drupal\Core\Form\FormStateInterface;
use Drupal\Core\Url;
/** /**
* Default style plugin to render an RSS feed. * Default style plugin to render an RSS feed.
...@@ -32,7 +33,7 @@ class Rss extends StylePluginBase { ...@@ -32,7 +33,7 @@ class Rss extends StylePluginBase {
*/ */
protected $usesRowPlugin = TRUE; protected $usesRowPlugin = TRUE;
public function attachTo(array &$build, $display_id, $path, $title) { public function attachTo(array &$build, $display_id, Url $feed_url, $title) {
$url_options = array(); $url_options = array();
$input = $this->view->getExposedInput(); $input = $this->view->getExposedInput();
if ($input) { if ($input) {
...@@ -40,7 +41,7 @@ public function attachTo(array &$build, $display_id, $path, $title) { ...@@ -40,7 +41,7 @@ public function attachTo(array &$build, $display_id, $path, $title) {
} }
$url_options['absolute'] = TRUE; $url_options['absolute'] = TRUE;
$url = _url($this->view->getUrl(NULL, $path), $url_options); $url = $feed_url->setOptions($url_options)->toString();
// Add the RSS icon to the view. // Add the RSS icon to the view.
$this->view->feedIcons[] = [ $this->view->feedIcons[] = [
......
...@@ -76,6 +76,8 @@ public function testEqualGroupedExposed() { ...@@ -76,6 +76,8 @@ public function testEqualGroupedExposed() {
$filters['name']['group_info']['default_group'] = 1; $filters['name']['group_info']['default_group'] = 1;
$view->setDisplay('page_1'); $view->setDisplay('page_1');
$view->displayHandlers->get('page_1')->overrideOption('filters', $filters); $view->displayHandlers->get('page_1')->overrideOption('filters', $filters);
$view->save();
$this->container->get('router.builder')->rebuild();
$this->executeView($view); $this->executeView($view);
$resultset = array( $resultset = array(
...@@ -129,6 +131,8 @@ public function testEqualGroupedNotExposed() { ...@@ -129,6 +131,8 @@ public function testEqualGroupedNotExposed() {
$filters['name']['group_info']['default_group'] = 2; $filters['name']['group_info']['default_group'] = 2;
$view->setDisplay('page_1'); $view->setDisplay('page_1');
$view->displayHandlers->get('page_1')->overrideOption('filters', $filters); $view->displayHandlers->get('page_1')->overrideOption('filters', $filters);
$view->save();
$this->container->get('router.builder')->rebuild();
$this->executeView($view); $this->executeView($view);
$resultset = array( $resultset = array(
...@@ -153,6 +157,7 @@ protected function getGroupedExposedFilters() { ...@@ -153,6 +157,7 @@ protected function getGroupedExposedFilters() {
$filters = array( $filters = array(
'name' => array( 'name' => array(
'id' => 'name', 'id' => 'name',
'plugin_id' => 'equality',
'table' => 'views_test_data', 'table' => 'views_test_data',
'field' => 'name', 'field' => 'name',
'relationship' => 'none', 'relationship' => 'none',
......
...@@ -80,6 +80,8 @@ public function testFilterNumericExposedGroupedSimple() { ...@@ -80,6 +80,8 @@ public function testFilterNumericExposedGroupedSimple() {
$filters['age']['group_info']['default_group'] = 1; $filters['age']['group_info']['default_group'] = 1;
$view->setDisplay('page_1'); $view->setDisplay('page_1');
$view->displayHandlers->get('page_1')->overrideOption('filters', $filters); $view->displayHandlers->get('page_1')->overrideOption('filters', $filters);
$view->save();
$this->container->get('router.builder')->rebuild();
$this->executeView($view); $this->executeView($view);
$resultset = array( $resultset = array(
...@@ -173,6 +175,8 @@ public function testFilterNumericExposedGroupedBetween() { ...@@ -173,6 +175,8 @@ public function testFilterNumericExposedGroupedBetween() {
$filters['age']['group_info']['default_group'] = 2; $filters['age']['group_info']['default_group'] = 2;
$view->setDisplay('page_1'); $view->setDisplay('page_1');
$view->displayHandlers->get('page_1')->overrideOption('filters', $filters); $view->displayHandlers->get('page_1')->overrideOption('filters', $filters);
$view->save();
$this->container->get('router.builder')->rebuild();
$this->executeView($view); $this->executeView($view);
$resultset = array( $resultset = array(
...@@ -201,6 +205,8 @@ public function testFilterNumericExposedGroupedNotBetween() { ...@@ -201,6 +205,8 @@ public function testFilterNumericExposedGroupedNotBetween() {
$filters['age']['group_info']['default_group'] = 3; $filters['age']['group_info']['default_group'] = 3;
$view->setDisplay('page_1'); $view->setDisplay('page_1');
$view->displayHandlers->get('page_1')->overrideOption('filters', $filters); $view->displayHandlers->get('page_1')->overrideOption('filters', $filters);
$view->save();
$this->container->get('router.builder')->rebuild();
$this->executeView($view); $this->executeView($view);
$resultset = array( $resultset = array(
...@@ -289,6 +295,8 @@ public function testFilterNumericExposedGroupedEmpty() { ...@@ -289,6 +295,8 @@ public function testFilterNumericExposedGroupedEmpty() {
$filters['age']['group_info']['default_group'] = 4; $filters['age']['group_info']['default_group'] = 4;
$view->setDisplay('page_1'); $view->setDisplay('page_1');
$view->displayHandlers->get('page_1')->overrideOption('filters', $filters); $view->displayHandlers->get('page_1')->overrideOption('filters', $filters);
$view->save();
$this->container->get('router.builder')->rebuild();
$this->executeView($view); $this->executeView($view);
$resultset = array( $resultset = array(
...@@ -305,6 +313,8 @@ public function testFilterNumericExposedGroupedNotEmpty() { ...@@ -305,6 +313,8 @@ public function testFilterNumericExposedGroupedNotEmpty() {
$filters['age']['group_info']['default_group'] = 5; $filters['age']['group_info']['default_group'] = 5;
$view->setDisplay('page_1'); $view->setDisplay('page_1');
$view->displayHandlers->get('page_1')->overrideOption('filters', $filters); $view->displayHandlers->get('page_1')->overrideOption('filters', $filters);
$view->save();
$this->container->get('router.builder')->rebuild();
$this->executeView($view); $this->executeView($view);
$resultset = array( $resultset = array(
...@@ -366,6 +376,7 @@ protected function getGroupedExposedFilters() { ...@@ -366,6 +376,7 @@ protected function getGroupedExposedFilters() {
$filters = array( $filters = array(
'age' => array( 'age' => array(
'id' => 'age', 'id' => 'age',
'plugin_id' => 'numeric',
'table' => 'views_test_data', 'table' => 'views_test_data',
'field' => 'age', 'field' => 'age',
'relationship' => 'none', 'relationship' => 'none',
......
...@@ -120,6 +120,8 @@ function testFilterStringGroupedExposedEqual() { ...@@ -120,6 +120,8 @@ function testFilterStringGroupedExposedEqual() {
$filters['name']['group_info']['default_group'] = 1; $filters['name']['group_info']['default_group'] = 1;
$view->setDisplay('page_1'); $view->setDisplay('page_1');
$view->displayHandlers->get('page_1')->overrideOption('filters', $filters); $view->displayHandlers->get('page_1')->overrideOption('filters', $filters);
$view->save();
$this->container->get('router.builder')->rebuild();
$this->executeView($view); $this->executeView($view);
...@@ -175,6 +177,8 @@ function testFilterStringGroupedExposedNotEqual() { ...@@ -175,6 +177,8 @@ function testFilterStringGroupedExposedNotEqual() {
$view->setDisplay('page_1'); $view->setDisplay('page_1');
$view->displayHandlers->get('page_1')->overrideOption('filters', $filters); $view->displayHandlers->get('page_1')->overrideOption('filters', $filters);
$view->save();
$this->container->get('router.builder')->rebuild();
$this->executeView($view); $this->executeView($view);
...@@ -230,6 +234,8 @@ function testFilterStringGroupedExposedContains() { ...@@ -230,6 +234,8 @@ function testFilterStringGroupedExposedContains() {
$filters['name']['group_info']['default_group'] = '3'; $filters['name']['group_info']['default_group'] = '3';
$view->setDisplay('page_1'); $view->setDisplay('page_1');
$view->displayHandlers->get('page_1')->overrideOption('filters', $filters); $view->displayHandlers->get('page_1')->overrideOption('filters', $filters);
$view->save();
$this->container->get('router.builder')->rebuild();
$this->executeView($view); $this->executeView($view);
...@@ -304,6 +310,8 @@ function testFilterStringGroupedExposedWord() { ...@@ -304,6 +310,8 @@ function testFilterStringGroupedExposedWord() {
$filters['name']['group_info']['default_group'] = '3'; $filters['name']['group_info']['default_group'] = '3';
$view->setDisplay('page_1'); $view->setDisplay('page_1');
$view->displayHandlers->get('page_1')->overrideOption('filters', $filters); $view->displayHandlers->get('page_1')->overrideOption('filters', $filters);
$view->save();
$this->container->get('router.builder')->rebuild();
$this->executeView($view); $this->executeView($view);
...@@ -369,6 +377,8 @@ function testFilterStringGroupedExposedStarts() { ...@@ -369,6 +377,8 @@ function testFilterStringGroupedExposedStarts() {
$filters['description']['group_info']['default_group'] = 2; $filters['description']['group_info']['default_group'] = 2;
$view->setDisplay('page_1'); $view->setDisplay('page_1');
$view->displayHandlers->get('page_1')->overrideOption('filters', $filters); $view->displayHandlers->get('page_1')->overrideOption('filters', $filters);
$view->save();
$this->container->get('router.builder')->rebuild();
$this->executeView($view); $this->executeView($view);
...@@ -420,6 +430,8 @@ function testFilterStringGroupedExposedNotStarts() { ...@@ -420,6 +430,8 @@ function testFilterStringGroupedExposedNotStarts() {
$filters['description']['group_info']['default_group'] = 3; $filters['description']['group_info']['default_group'] = 3;
$view->setDisplay('page_1'); $view->setDisplay('page_1');
$view->displayHandlers->get('page_1')->overrideOption('filters', $filters); $view->displayHandlers->get('page_1')->overrideOption('filters', $filters);
$view->save();
$this->container->get('router.builder')->rebuild();
$this->executeView($view); $this->executeView($view);
...@@ -474,6 +486,8 @@ function testFilterStringGroupedExposedEnds() { ...@@ -474,6 +486,8 @@ function testFilterStringGroupedExposedEnds() {
$filters['description']['group_info']['default_group'] = 4; $filters['description']['group_info']['default_group'] = 4;
$view->setDisplay('page_1'); $view->setDisplay('page_1');
$view->displayHandlers->get('page_1')->overrideOption('filters', $filters); $view->displayHandlers->get('page_1')->overrideOption('filters', $filters);
$view->save();
$this->container->get('router.builder')->rebuild();
$this->executeView($view); $this->executeView($view);
...@@ -525,6 +539,8 @@ function testFilterStringGroupedExposedNotEnds() { ...@@ -525,6 +539,8 @@ function testFilterStringGroupedExposedNotEnds() {
$filters['description']['group_info']['default_group'] = 5; $filters['description']['group_info']['default_group'] = 5;
$view->setDisplay('page_1'); $view->setDisplay('page_1');
$view->displayHandlers->get('page_1')->overrideOption('filters', $filters); $view->displayHandlers->get('page_1')->overrideOption('filters', $filters);
$view->save();
$this->container->get('router.builder')->rebuild();
$this->executeView($view); $this->executeView($view);
...@@ -578,6 +594,8 @@ function testFilterStringGroupedExposedNot() { ...@@ -578,6 +594,8 @@ function testFilterStringGroupedExposedNot() {
$filters['description']['group_info']['default_group'] = 6; $filters['description']['group_info']['default_group'] = 6;
$view->setDisplay('page_1');