Commit 777bc650 authored by webchick's avatar webchick

Issue #2327373 by dawehner: Standardize view entity route names.

parent c16c1c71
...@@ -275,8 +275,8 @@ public function testBlockContextualLinks() { ...@@ -275,8 +275,8 @@ public function testBlockContextualLinks() {
$cached_block = $this->drupalPlaceBlock('views_block:test_view_block-block_1', array('cache' => array('max_age' => 3600))); $cached_block = $this->drupalPlaceBlock('views_block:test_view_block-block_1', array('cache' => array('max_age' => 3600)));
$this->drupalGet('test-page'); $this->drupalGet('test-page');
$id = 'block:block=' . $block->id() . ':|views_ui_edit:view=test_view_block:location=block&name=test_view_block&display_id=block_1'; $id = 'block:block=' . $block->id() . ':|entity.view.edit_form:view=test_view_block:location=block&name=test_view_block&display_id=block_1';
$cached_id = 'block:block=' . $cached_block->id() . ':|views_ui_edit:view=test_view_block:location=block&name=test_view_block&display_id=block_1'; $cached_id = 'block:block=' . $cached_block->id() . ':|entity.view.edit_form:view=test_view_block:location=block&name=test_view_block&display_id=block_1';
// @see \Drupal\contextual\Tests\ContextualDynamicContextTest:assertContextualLinkPlaceHolder() // @see \Drupal\contextual\Tests\ContextualDynamicContextTest:assertContextualLinkPlaceHolder()
$this->assertRaw('<div' . new Attribute(array('data-contextual-id' => $id)) . '></div>', format_string('Contextual link placeholder with id @id exists.', array('@id' => $id))); $this->assertRaw('<div' . new Attribute(array('data-contextual-id' => $id)) . '></div>', format_string('Contextual link placeholder with id @id exists.', array('@id' => $id)));
$this->assertRaw('<div' . new Attribute(array('data-contextual-id' => $cached_id)) . '></div>', format_string('Contextual link placeholder with id @id exists.', array('@id' => $cached_id))); $this->assertRaw('<div' . new Attribute(array('data-contextual-id' => $cached_id)) . '></div>', format_string('Contextual link placeholder with id @id exists.', array('@id' => $cached_id)));
...@@ -287,8 +287,8 @@ public function testBlockContextualLinks() { ...@@ -287,8 +287,8 @@ public function testBlockContextualLinks() {
$response = $this->drupalPost('contextual/render', 'application/json', $post, array('query' => array('destination' => 'test-page'))); $response = $this->drupalPost('contextual/render', 'application/json', $post, array('query' => array('destination' => 'test-page')));
$this->assertResponse(200); $this->assertResponse(200);
$json = Json::decode($response); $json = Json::decode($response);
$this->assertIdentical($json[$id], '<ul class="contextual-links"><li class="block-configure"><a href="' . base_path() . 'admin/structure/block/manage/' . $block->id() . '">Configure block</a></li><li class="views-uiedit"><a href="' . base_path() . 'admin/structure/views/view/test_view_block/edit/block_1">Edit view</a></li></ul>'); $this->assertIdentical($json[$id], '<ul class="contextual-links"><li class="block-configure"><a href="' . base_path() . 'admin/structure/block/manage/' . $block->id() . '">Configure block</a></li><li class="entityviewedit-form"><a href="' . base_path() . 'admin/structure/views/view/test_view_block/edit/block_1">Edit view</a></li></ul>');
$this->assertIdentical($json[$cached_id], '<ul class="contextual-links"><li class="block-configure"><a href="' . base_path() . 'admin/structure/block/manage/' . $cached_block->id() . '">Configure block</a></li><li class="views-uiedit"><a href="' . base_path() . 'admin/structure/views/view/test_view_block/edit/block_1">Edit view</a></li></ul>'); $this->assertIdentical($json[$cached_id], '<ul class="contextual-links"><li class="block-configure"><a href="' . base_path() . 'admin/structure/block/manage/' . $cached_block->id() . '">Configure block</a></li><li class="entityviewedit-form"><a href="' . base_path() . 'admin/structure/views/view/test_view_block/edit/block_1">Edit view</a></li></ul>');
} }
} }
...@@ -232,7 +232,7 @@ public function getContextualLinkGroup() { ...@@ -232,7 +232,7 @@ public function getContextualLinkGroup() {
case 'block': case 'block':
return $this->entityType; return $this->entityType;
case 'view': case 'view':
return 'views_ui_edit'; return 'entity.view.edit_form';
default: default:
return NULL; return NULL;
} }
......
...@@ -508,7 +508,7 @@ public function testViewsTranslationUI() { ...@@ -508,7 +508,7 @@ public function testViewsTranslationUI() {
$this->drupalLogin($this->admin_user); $this->drupalLogin($this->admin_user);
// Assert contextual link related to views. // Assert contextual link related to views.
$ids = array('views_ui_edit:view=frontpage:location=page&name=frontpage&display_id=page_1'); $ids = array('entity.view.edit_form:view=frontpage:location=page&name=frontpage&display_id=page_1');
$response = $this->renderContextualLinks($ids, 'node'); $response = $this->renderContextualLinks($ids, 'node');
$this->assertResponse(200); $this->assertResponse(200);
$json = Json::decode($response); $json = Json::decode($response);
......
...@@ -60,7 +60,7 @@ function testDifferentPermissions() { ...@@ -60,7 +60,7 @@ function testDifferentPermissions() {
'node:node=' . $node1->id() . ':changed=' . $node1->getChangedTime(), 'node:node=' . $node1->id() . ':changed=' . $node1->getChangedTime(),
'node:node=' . $node2->id() . ':changed=' . $node2->getChangedTime(), 'node:node=' . $node2->id() . ':changed=' . $node2->getChangedTime(),
'node:node=' . $node3->id() . ':changed=' . $node3->getChangedTime(), 'node:node=' . $node3->id() . ':changed=' . $node3->getChangedTime(),
'views_ui_edit:view=frontpage:location=page&name=frontpage&display_id=page_1', 'entity.view.edit_form:view=frontpage:location=page&name=frontpage&display_id=page_1',
); );
// Editor user: can access contextual links and can edit articles. // Editor user: can access contextual links and can edit articles.
......
...@@ -152,7 +152,7 @@ public function buildConfigurationForm(array $form, FormStateInterface $form_sta ...@@ -152,7 +152,7 @@ public function buildConfigurationForm(array $form, FormStateInterface $form_sta
); );
if ($this->view->storage->access('edit') && \Drupal::moduleHandler()->moduleExists('views_ui')) { if ($this->view->storage->access('edit') && \Drupal::moduleHandler()->moduleExists('views_ui')) {
$form['views_label']['#description'] = $this->t('Changing the title here means it cannot be dynamically altered anymore. (Try changing it directly in <a href="@url">@name</a>.)', array('@url' => \Drupal::url('views_ui.edit_display', array('view' => $this->view->storage->id(), 'display_id' => $this->displayID)), '@name' => $this->view->storage->label())); $form['views_label']['#description'] = $this->t('Changing the title here means it cannot be dynamically altered anymore. (Try changing it directly in <a href="@url">@name</a>.)', array('@url' => \Drupal::url('entity.view.edit_display_form', array('view' => $this->view->storage->id(), 'display_id' => $this->displayID)), '@name' => $this->view->storage->label()));
} }
else { else {
$form['views_label']['#description'] = $this->t('Changing the title here means it cannot be dynamically altered anymore.'); $form['views_label']['#description'] = $this->t('Changing the title here means it cannot be dynamically altered anymore.');
......
...@@ -61,7 +61,7 @@ public function buildConfigurationForm(array $form, FormStateInterface $form_sta ...@@ -61,7 +61,7 @@ public function buildConfigurationForm(array $form, FormStateInterface $form_sta
$id = $view->storage->id(); $id = $view->storage->id();
$label = $view->storage->label(); $label = $view->storage->label();
if ($this->moduleHandler->moduleExists('views_ui')) { if ($this->moduleHandler->moduleExists('views_ui')) {
$message = $this->t('This link is provided by the Views module. The path can be changed by editing the view <a href="@url">@label</a>', array('@url' => \Drupal::url('views_ui.edit', array('view' => $id)), '@label' => $label)); $message = $this->t('This link is provided by the Views module. The path can be changed by editing the view <a href="@url">@label</a>', array('@url' => \Drupal::url('entity.view.edit_form', array('view' => $id)), '@label' => $label));
} }
else { else {
$message = $this->t('This link is provided by the Views module from view %label.', array('%label' => $label)); $message = $this->t('This link is provided by the Views module from view %label.', array('%label' => $label));
......
...@@ -3,8 +3,8 @@ module: views_ui ...@@ -3,8 +3,8 @@ module: views_ui
label: 'Views ui' label: 'Views ui'
langcode: en langcode: en
routes: routes:
- route_name: views_ui.edit - route_name: entity.view.edit_form
- route_name: views_ui.edit_display - route_name: entity.view.edit_display_form
tips: tips:
views-main: views-main:
id: views-main id: views-main
......
...@@ -91,7 +91,7 @@ public function reportFields() { ...@@ -91,7 +91,7 @@ public function reportFields() {
foreach ($fields as $field_name => $views) { foreach ($fields as $field_name => $views) {
$rows[$field_name]['data'][0] = String::checkPlain($field_name); $rows[$field_name]['data'][0] = String::checkPlain($field_name);
foreach ($views as $view) { foreach ($views as $view) {
$rows[$field_name]['data'][1][] = $this->l($view, 'views_ui.edit', array('view' => $view)); $rows[$field_name]['data'][1][] = $this->l($view, 'entity.view.edit_form', array('view' => $view));
} }
$rows[$field_name]['data'][1] = SafeMarkup::set(implode(', ', $rows[$field_name]['data'][1])); $rows[$field_name]['data'][1] = SafeMarkup::set(implode(', ', $rows[$field_name]['data'][1]));
} }
...@@ -119,7 +119,7 @@ public function reportPlugins() { ...@@ -119,7 +119,7 @@ public function reportPlugins() {
foreach ($rows as &$row) { foreach ($rows as &$row) {
// Link each view name to the view itself. // Link each view name to the view itself.
foreach ($row['views'] as $row_name => $view) { foreach ($row['views'] as $row_name => $view) {
$row['views'][$row_name] = $this->l($view, 'views_ui.edit', array('view' => $view)); $row['views'][$row_name] = $this->l($view, 'entity.view.edit_form', array('view' => $view));
} }
$row['views'] = SafeMarkup::set(implode(', ', $row['views'])); $row['views'] = SafeMarkup::set(implode(', ', $row['views']));
} }
......
...@@ -91,13 +91,13 @@ public function testDisplayPluginsAlter() { ...@@ -91,13 +91,13 @@ public function testDisplayPluginsAlter() {
$definitions = Views::pluginManager('display')->getDefinitions(); $definitions = Views::pluginManager('display')->getDefinitions();
$expected = array( $expected = array(
'route_name' => 'views_ui.edit', 'route_name' => 'entity.view.edit_form',
'route_parameters_names' => array('view' => 'id'), 'route_parameters_names' => array('view' => 'id'),
); );
// Test the expected views_ui array exists on each definition. // Test the expected views_ui array exists on each definition.
foreach ($definitions as $definition) { foreach ($definitions as $definition) {
$this->assertIdentical($definition['contextual links']['views_ui_edit'], $expected, 'Expected views_ui array found in plugin definition.'); $this->assertIdentical($definition['contextual links']['entity.view.edit_form'], $expected, 'Expected views_ui array found in plugin definition.');
} }
} }
...@@ -175,7 +175,7 @@ public function testPageContextualLinks() { ...@@ -175,7 +175,7 @@ public function testPageContextualLinks() {
$view->enable()->save(); $view->enable()->save();
$this->drupalGet('test-display'); $this->drupalGet('test-display');
$id = 'views_ui_edit:view=test_display:location=page&name=test_display&display_id=page_1'; $id = 'entity.view.edit_form:view=test_display:location=page&name=test_display&display_id=page_1';
// @see \Drupal\contextual\Tests\ContextualDynamicContextTest:assertContextualLinkPlaceHolder() // @see \Drupal\contextual\Tests\ContextualDynamicContextTest:assertContextualLinkPlaceHolder()
$this->assertRaw('<div' . new Attribute(array('data-contextual-id' => $id)) . '></div>', format_string('Contextual link placeholder with id @id exists.', array('@id' => $id))); $this->assertRaw('<div' . new Attribute(array('data-contextual-id' => $id)) . '></div>', format_string('Contextual link placeholder with id @id exists.', array('@id' => $id)));
...@@ -185,7 +185,7 @@ public function testPageContextualLinks() { ...@@ -185,7 +185,7 @@ public function testPageContextualLinks() {
$response = $this->drupalPost('contextual/render', 'application/json', $post, array('query' => array('destination' => 'test-display'))); $response = $this->drupalPost('contextual/render', 'application/json', $post, array('query' => array('destination' => 'test-display')));
$this->assertResponse(200); $this->assertResponse(200);
$json = Json::decode($response); $json = Json::decode($response);
$this->assertIdentical($json[$id], '<ul class="contextual-links"><li class="views-uiedit"><a href="' . base_path() . 'admin/structure/views/view/test_display/edit/page_1">Edit view</a></li></ul>'); $this->assertIdentical($json[$id], '<ul class="contextual-links"><li class="entityviewedit-form"><a href="' . base_path() . 'admin/structure/views/view/test_display/edit/page_1">Edit view</a></li></ul>');
} }
/** /**
......
...@@ -141,7 +141,7 @@ public function form(array $form, FormStateInterface $form_state) { ...@@ -141,7 +141,7 @@ public function form(array $form, FormStateInterface $form_state) {
$lock_message_substitutions = array( $lock_message_substitutions = array(
'!user' => drupal_render($username), '!user' => drupal_render($username),
'!age' => $this->dateFormatter->formatInterval(REQUEST_TIME - $view->lock->updated), '!age' => $this->dateFormatter->formatInterval(REQUEST_TIME - $view->lock->updated),
'!break' => $view->url('break-lock'), '!break' => $view->url('break-lock-form'),
); );
$form['locked'] = array( $form['locked'] = array(
'#type' => 'container', '#type' => 'container',
...@@ -296,7 +296,7 @@ public function submit(array $form, FormStateInterface $form_state) { ...@@ -296,7 +296,7 @@ public function submit(array $form, FormStateInterface $form_state) {
unset($displays[$id]); unset($displays[$id]);
// Redirect the user to the renamed display to be sure that the page itself exists and doesn't throw errors. // Redirect the user to the renamed display to be sure that the page itself exists and doesn't throw errors.
$form_state->setRedirect('views_ui.edit_display', array( $form_state->setRedirect('entity.view.edit_display_form', array(
'view' => $view->id(), 'view' => $view->id(),
'display_id' => $new_id, 'display_id' => $new_id,
)); ));
...@@ -592,7 +592,7 @@ public function submitDisplayUndoDelete($form, FormStateInterface $form_state) { ...@@ -592,7 +592,7 @@ public function submitDisplayUndoDelete($form, FormStateInterface $form_state) {
$view->cacheSet(); $view->cacheSet();
// Redirect to the top-level edit page. // Redirect to the top-level edit page.
$form_state->setRedirect('views_ui.edit_display', array( $form_state->setRedirect('entity.view.edit_display_form', array(
'view' => $view->id(), 'view' => $view->id(),
'display_id' => $id, 'display_id' => $id,
)); ));
...@@ -611,7 +611,7 @@ public function submitDisplayEnable($form, FormStateInterface $form_state) { ...@@ -611,7 +611,7 @@ public function submitDisplayEnable($form, FormStateInterface $form_state) {
$view->cacheSet(); $view->cacheSet();
// Redirect to the top-level edit page. // Redirect to the top-level edit page.
$form_state->setRedirect('views_ui.edit_display', array( $form_state->setRedirect('entity.view.edit_display_form', array(
'view' => $view->id(), 'view' => $view->id(),
'display_id' => $id, 'display_id' => $id,
)); ));
...@@ -629,7 +629,7 @@ public function submitDisplayDisable($form, FormStateInterface $form_state) { ...@@ -629,7 +629,7 @@ public function submitDisplayDisable($form, FormStateInterface $form_state) {
$view->cacheSet(); $view->cacheSet();
// Redirect to the top-level edit page. // Redirect to the top-level edit page.
$form_state->setRedirect('views_ui.edit_display', array( $form_state->setRedirect('entity.view.edit_display_form', array(
'view' => $view->id(), 'view' => $view->id(),
'display_id' => $id, 'display_id' => $id,
)); ));
...@@ -708,7 +708,7 @@ public function renderDisplayTop(ViewUI $view) { ...@@ -708,7 +708,7 @@ public function renderDisplayTop(ViewUI $view) {
), ),
'duplicate' => array( 'duplicate' => array(
'title' => $this->t('Duplicate view'), 'title' => $this->t('Duplicate view'),
) + $view->urlInfo('duplicate')->toArray(), ) + $view->urlInfo('duplicate-form')->toArray(),
'reorder' => array( 'reorder' => array(
'title' => $this->t('Reorder displays'), 'title' => $this->t('Reorder displays'),
'href' => "admin/structure/views/nojs/reorder-displays/{$view->id()}/$display_id", 'href' => "admin/structure/views/nojs/reorder-displays/{$view->id()}/$display_id",
...@@ -827,7 +827,7 @@ public function submitDisplayDuplicate($form, FormStateInterface $form_state) { ...@@ -827,7 +827,7 @@ public function submitDisplayDuplicate($form, FormStateInterface $form_state) {
$view->cacheSet(); $view->cacheSet();
// Redirect to the new display's edit page. // Redirect to the new display's edit page.
$form_state->setRedirect('views_ui.edit_display', array( $form_state->setRedirect('entity.view.edit_display_form', array(
'view' => $view->id(), 'view' => $view->id(),
'display_id' => $new_display_id, 'display_id' => $new_display_id,
)); ));
...@@ -849,7 +849,7 @@ public function submitDisplayAdd($form, FormStateInterface $form_state) { ...@@ -849,7 +849,7 @@ public function submitDisplayAdd($form, FormStateInterface $form_state) {
$view->cacheSet(); $view->cacheSet();
// Redirect to the new display's edit page. // Redirect to the new display's edit page.
$form_state->setRedirect('views_ui.edit_display', array( $form_state->setRedirect('entity.view.edit_display_form', array(
'view' => $view->id(), 'view' => $view->id(),
'display_id' => $display_id, 'display_id' => $display_id,
)); ));
...@@ -885,7 +885,7 @@ public function submitDuplicateDisplayAsType($form, FormStateInterface $form_sta ...@@ -885,7 +885,7 @@ public function submitDuplicateDisplayAsType($form, FormStateInterface $form_sta
$view->cacheSet(); $view->cacheSet();
// Redirect to the new display's edit page. // Redirect to the new display's edit page.
$form_state->setRedirect('views_ui.edit_display', array( $form_state->setRedirect('entity.view.edit_display_form', array(
'view' => $view->id(), 'view' => $view->id(),
'display_id' => $new_display_id, 'display_id' => $new_display_id,
)); ));
......
...@@ -145,17 +145,17 @@ public function buildHeader() { ...@@ -145,17 +145,17 @@ public function buildHeader() {
public function getDefaultOperations(EntityInterface $entity) { public function getDefaultOperations(EntityInterface $entity) {
$operations = parent::getDefaultOperations($entity); $operations = parent::getDefaultOperations($entity);
if ($entity->hasLinkTemplate('duplicate')) { if ($entity->hasLinkTemplate('duplicate-form')) {
$operations['duplicate'] = array( $operations['duplicate'] = array(
'title' => $this->t('Duplicate'), 'title' => $this->t('Duplicate'),
'weight' => 15, 'weight' => 15,
) + $entity->urlInfo('duplicate')->toArray(); ) + $entity->urlInfo('duplicate-form')->toArray();
} }
// Add AJAX functionality to enable/disable operations. // Add AJAX functionality to enable/disable operations.
foreach (array('enable', 'disable') as $op) { foreach (array('enable', 'disable') as $op) {
if (isset($operations[$op])) { if (isset($operations[$op])) {
$operations[$op]['route_name'] = "views_ui.$op"; $operations[$op]['route_name'] = "entity.view.{$op}";
$operations[$op]['route_parameters'] = array('view' => $entity->id()); $operations[$op]['route_parameters'] = array('view' => $entity->id());
// Enable and disable operations should use AJAX. // Enable and disable operations should use AJAX.
......
...@@ -635,7 +635,7 @@ public function renderPreview($display_id, $args = array()) { ...@@ -635,7 +635,7 @@ public function renderPreview($display_id, $args = array()) {
$show_additional_queries = $config->get('ui.show.additional_queries'); $show_additional_queries = $config->get('ui.show.additional_queries');
Timer::start('views_ui.preview'); Timer::start('entity.view.preview_form');
if ($show_additional_queries) { if ($show_additional_queries) {
$this->startQueryCapture(); $this->startQueryCapture();
...@@ -649,7 +649,7 @@ public function renderPreview($display_id, $args = array()) { ...@@ -649,7 +649,7 @@ public function renderPreview($display_id, $args = array()) {
$this->endQueryCapture(); $this->endQueryCapture();
} }
$this->render_time = Timer::stop('views_ui.preview'); $this->render_time = Timer::stop('entity.view.preview_form');
views_ui_contextual_links_suppress_pop(); views_ui_contextual_links_suppress_pop();
......
views_ui.edit: entity.view.edit_form:
title: 'Edit view' title: 'Edit view'
route_name: views_ui.edit route_name: entity.view.edit_form
group: views_ui_edit group: entity.view.edit_form
views_ui.preview: entity.view.preview_form:
title: 'Preview view' title: 'Preview view'
route_name: views_ui.preview route_name: entity.view.preview_form
group: views_ui_preview group: entity.view.preview_form
...@@ -24,7 +24,7 @@ views_ui.reports_fields: ...@@ -24,7 +24,7 @@ views_ui.reports_fields:
title: 'Used in views' title: 'Used in views'
base_route: field_ui.list base_route: field_ui.list
views_ui.edit: entity.view.edit_form:
title: 'Edit' title: 'Edit'
route_name: views_ui.edit route_name: entity.view.edit_form
base_route: views_ui.edit base_route: entity.view.edit_form
...@@ -51,14 +51,14 @@ function views_ui_entity_type_build(array &$entity_types) { ...@@ -51,14 +51,14 @@ function views_ui_entity_type_build(array &$entity_types) {
->setFormClass('delete', 'Drupal\views_ui\ViewDeleteForm') ->setFormClass('delete', 'Drupal\views_ui\ViewDeleteForm')
->setFormClass('break_lock', 'Drupal\views_ui\Form\BreakLockForm') ->setFormClass('break_lock', 'Drupal\views_ui\Form\BreakLockForm')
->setListBuilderClass('Drupal\views_ui\ViewListBuilder') ->setListBuilderClass('Drupal\views_ui\ViewListBuilder')
->setLinkTemplate('edit-form', 'views_ui.edit') ->setLinkTemplate('edit-form', 'entity.view.edit_form')
->setLinkTemplate('edit-display-form', 'views_ui.edit_display') ->setLinkTemplate('edit-display-form', 'entity.view.edit_display_form')
->setLinkTemplate('preview-form', 'views_ui.preview') ->setLinkTemplate('preview-form', 'entity.view.preview_form')
->setLinkTemplate('duplicate', 'views_ui.duplicate') ->setLinkTemplate('duplicate-form', 'entity.view.duplicate_form')
->setLinkTemplate('delete-form', 'views_ui.delete') ->setLinkTemplate('delete-form', 'entity.view.delete_form')
->setLinkTemplate('enable', 'views_ui.enable') ->setLinkTemplate('enable', 'entity.view.enable')
->setLinkTemplate('disable', 'views_ui.disable') ->setLinkTemplate('disable', 'entity.view.disable')
->setLinkTemplate('break-lock', 'views_ui.break_lock'); ->setLinkTemplate('break-lock-form', 'entity.view.break_lock_form');
} }
/** /**
...@@ -223,8 +223,8 @@ function views_ui_views_plugins_display_alter(&$plugins) { ...@@ -223,8 +223,8 @@ function views_ui_views_plugins_display_alter(&$plugins) {
// paths underneath "admin/structure/views/view/{$view->id()}" (i.e., paths // paths underneath "admin/structure/views/view/{$view->id()}" (i.e., paths
// for editing and performing other contextual actions on the view). // for editing and performing other contextual actions on the view).
foreach ($plugins as &$display) { foreach ($plugins as &$display) {
$display['contextual links']['views_ui_edit'] = array( $display['contextual links']['entity.view.edit_form'] = array(
'route_name' => 'views_ui.edit', 'route_name' => 'entity.view.edit_form',
'route_parameters_names' => array('view' => 'id'), 'route_parameters_names' => array('view' => 'id'),
); );
} }
...@@ -242,10 +242,10 @@ function views_ui_contextual_links_view_alter(&$element, $items) { ...@@ -242,10 +242,10 @@ function views_ui_contextual_links_view_alter(&$element, $items) {
// Append the display ID to the Views UI edit links, so that clicking on the // Append the display ID to the Views UI edit links, so that clicking on the
// contextual link takes you directly to the correct display tab on the edit // contextual link takes you directly to the correct display tab on the edit
// screen. // screen.
elseif (!empty($element['#links']['views-uiedit'])) { elseif (!empty($element['#links']['entityviewedit-form'])) {
$display_id = $items['views_ui.edit']['metadata']['display_id']; $display_id = $items['entity.view.edit_form']['metadata']['display_id'];
$element['#links']['views-uiedit']['route_parameters']['display_id'] = $display_id; $element['#links']['entityviewedit-form']['route_parameters']['display_id'] = $display_id;
$element['#links']['views-uiedit']['route_name'] = 'views_ui.edit_display'; $element['#links']['entityviewedit-form']['route_name'] = 'entity.view.edit_display_form';
} }
} }
......
...@@ -46,7 +46,7 @@ views_ui.reports_plugins: ...@@ -46,7 +46,7 @@ views_ui.reports_plugins:
requirements: requirements:
_permission: 'administer views' _permission: 'administer views'
views_ui.enable: entity.view.enable:
path: '/admin/structure/views/view/{view}/enable' path: '/admin/structure/views/view/{view}/enable'
defaults: defaults:
_controller: '\Drupal\views_ui\Controller\ViewsUIController::ajaxOperation' _controller: '\Drupal\views_ui\Controller\ViewsUIController::ajaxOperation'
...@@ -55,7 +55,7 @@ views_ui.enable: ...@@ -55,7 +55,7 @@ views_ui.enable:
_entity_access: view.enable _entity_access: view.enable
_csrf_token: 'TRUE' _csrf_token: 'TRUE'
views_ui.disable: entity.view.disable:
path: '/admin/structure/views/view/{view}/disable' path: '/admin/structure/views/view/{view}/disable'
defaults: defaults:
_controller: '\Drupal\views_ui\Controller\ViewsUIController::ajaxOperation' _controller: '\Drupal\views_ui\Controller\ViewsUIController::ajaxOperation'
...@@ -64,7 +64,7 @@ views_ui.disable: ...@@ -64,7 +64,7 @@ views_ui.disable:
_entity_access: view.disable _entity_access: view.disable
_csrf_token: 'TRUE' _csrf_token: 'TRUE'
views_ui.duplicate: entity.view.duplicate_form:
path: '/admin/structure/views/view/{view}/duplicate' path: '/admin/structure/views/view/{view}/duplicate'
defaults: defaults:
_entity_form: 'view.duplicate' _entity_form: 'view.duplicate'
...@@ -72,7 +72,7 @@ views_ui.duplicate: ...@@ -72,7 +72,7 @@ views_ui.duplicate:
requirements: requirements:
_entity_access: view.duplicate _entity_access: view.duplicate
views_ui.delete: entity.view.delete_form:
path: '/admin/structure/views/view/{view}/delete' path: '/admin/structure/views/view/{view}/delete'
defaults: defaults:
_entity_form: 'view.delete' _entity_form: 'view.delete'
...@@ -87,7 +87,7 @@ views_ui.autocomplete: ...@@ -87,7 +87,7 @@ views_ui.autocomplete:
requirements: requirements:
_permission: 'administer views' _permission: 'administer views'
views_ui.edit: entity.view.edit_form:
path: '/admin/structure/views/view/{view}' path: '/admin/structure/views/view/{view}'
options: options:
parameters: parameters:
...@@ -99,7 +99,7 @@ views_ui.edit: ...@@ -99,7 +99,7 @@ views_ui.edit:
requirements: requirements:
_entity_access: view.update _entity_access: view.update
views_ui.edit_display: entity.view.edit_display_form:
path: '/admin/structure/views/view/{view}/edit/{display_id}' path: '/admin/structure/views/view/{view}/edit/{display_id}'
options: options:
parameters: parameters:
...@@ -112,7 +112,7 @@ views_ui.edit_display: ...@@ -112,7 +112,7 @@ views_ui.edit_display:
requirements: requirements:
_entity_access: view.update _entity_access: view.update
views_ui.preview: entity.view.preview_form:
path: '/admin/structure/views/view/{view}/preview/{display_id}' path: '/admin/structure/views/view/{view}/preview/{display_id}'
options: options:
parameters: parameters:
...@@ -125,7 +125,7 @@ views_ui.preview: ...@@ -125,7 +125,7 @@ views_ui.preview:
requirements: requirements:
_permission: 'administer views' _permission: 'administer views'
views_ui.break_lock: entity.view.break_lock_form:
path: '/admin/structure/views/view/{view}/break-lock' path: '/admin/structure/views/view/{view}/break-lock'
defaults: defaults:
_entity_form: 'view.break_lock' _entity_form: 'view.break_lock'
......
Markdown is supported
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