Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
project
drupal
Commits
742908a6
Commit
742908a6
authored
Sep 11, 2013
by
alexpott
Browse files
Issue
#2057427
by dawehner, olli: Fixed No delete operation available while editing a view.
parent
cc1f3fde
Changes
2
Hide whitespace changes
Inline
Side-by-side
core/modules/views_ui/lib/Drupal/views_ui/Tests/ViewEditTest.php
0 → 100644
View file @
742908a6
<?php
/**
* @file
* Contains \Drupal\views_ui\Tests\ViewEditTest.
*/
namespace
Drupal\views_ui\Tests
;
use
Drupal\views\Plugin\Core\Entity\View
;
/**
* Tests some general functionality of editing views, like deleting a view.
*/
class
ViewEditTest
extends
UITestBase
{
/**
* Views used by this test.
*
* @var array
*/
public
static
$testViews
=
array
(
'test_view'
);
public
static
function
getInfo
()
{
return
array
(
'name'
=>
'General views edit test'
,
'description'
=>
'Tests some general functionality of editing views, like deleting a view.'
,
'group'
=>
'Views UI'
);
}
/**
* Tests the delete link on a views UI.
*/
public
function
testDeleteLink
()
{
$this
->
drupalGet
(
'admin/structure/views/view/test_view'
);
$this
->
assertLink
(
t
(
'Delete view'
),
0
,
'Ensure that the view delete link appears'
);
$this
->
clickLink
(
t
(
'Delete view'
));
$this
->
assertUrl
(
'admin/structure/views/view/test_view/delete'
);
$this
->
drupalPost
(
NULL
,
array
(),
t
(
'Delete'
));
$this
->
assertUrl
(
'admin/structure/views'
);
$view
=
$this
->
container
->
get
(
'plugin.manager.entity'
)
->
getStorageController
(
'view'
)
->
load
(
'test_view'
);
$this
->
assertFalse
(
$view
instanceof
View
);
}
}
core/modules/views_ui/lib/Drupal/views_ui/ViewEditFormController.php
View file @
742908a6
...
...
@@ -682,6 +682,13 @@ public function renderDisplayTop(ViewUI $view) {
),
);
if
(
$view
->
access
(
'delete'
))
{
$element
[
'extra_actions'
][
'#links'
][
'delete'
]
=
array
(
'title'
=>
$this
->
t
(
'Delete view'
),
'href'
=>
"admin/structure/views/view/
{
$view
->
id
()
}
/delete"
,
);
}
// Let other modules add additional links here.
\
Drupal
::
moduleHandler
()
->
alter
(
'views_ui_display_top_links'
,
$element
[
'extra_actions'
][
'#links'
],
$view
,
$display_id
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment