Updated: Comment 0

Problem/Motivation

While editing a view there is no way to delete a view at the moment.

Proposed resolution

Readd the delete link.

Remaining tasks

User interface changes

API changes

Files: 
CommentFileSizeAuthor
#15 Screen_Shot_2013-09-09_at_15.08.11.png140.2 KBdamiankloip
#12 vdc-2057427-12.patch2.36 KBolli
PASSED: [[SimpleTest]]: [MySQL] 58,750 pass(es).
[ View ]
#12 interdiff.txt1.14 KBolli
#9 vdc-2057427-9.patch2.28 KBolli
PASSED: [[SimpleTest]]: [MySQL] 58,571 pass(es).
[ View ]
#9 interdiff-2057427-7-9.txt1.32 KBolli
#7 vdc-2057427-7.patch2.29 KBdawehner
FAILED: [[SimpleTest]]: [MySQL] 57,676 pass(es), 1 fail(s), and 0 exception(s).
[ View ]
#7 interdiff.txt789 bytesdawehner
#1 vdc-2057427-1.patch2.2 KBdawehner
PASSED: [[SimpleTest]]: [MySQL] 57,937 pass(es).
[ View ]

Comments

dawehner’s picture

Status:Active» Needs review
StatusFileSize
new2.2 KB
PASSED: [[SimpleTest]]: [MySQL] 57,937 pass(es).
[ View ]

There we go.

Status:Needs review» Needs work
Issue tags:-VDC

The last submitted patch, vdc-2057427-1.patch, failed testing.

dawehner’s picture

Status:Needs work» Needs review

#1: vdc-2057427-1.patch queued for re-testing.

Status:Needs review» Needs work

The last submitted patch, vdc-2057427-1.patch, failed testing.

dawehner’s picture

Status:Needs work» Needs review
Issue tags:+VDC

#1: vdc-2057427-1.patch queued for re-testing.

olli’s picture

Status:Needs review» Needs work

Tested manually and successfully deleted the frontpage view.

+++ b/core/modules/views_ui/lib/Drupal/views_ui/Tests/ViewEditTest.php
@@ -0,0 +1,46 @@
+    debug($view);

Should we replace this with an assert?

dawehner’s picture

Status:Needs work» Needs review
StatusFileSize
new789 bytes
new2.29 KB
FAILED: [[SimpleTest]]: [MySQL] 57,676 pass(es), 1 fail(s), and 0 exception(s).
[ View ]

Good point.

Status:Needs review» Needs work

The last submitted patch, vdc-2057427-7.patch, failed testing.

olli’s picture

Status:Needs work» Needs review
StatusFileSize
new1.32 KB
new2.28 KB
PASSED: [[SimpleTest]]: [MySQL] 58,571 pass(es).
[ View ]

This should fix it.

olli’s picture

+++ b/core/modules/views_ui/lib/Drupal/views_ui/ViewEditFormController.php
@@ -679,6 +679,10 @@ public function renderDisplayTop(ViewUI $view) {
+        'delete' => array(
+          'title' => $this->t('Delete view'),
+          'href' => "admin/structure/views/view/{$view->id()}/delete",
+        ),

Few lines below this is:

    if (isset($view->type) && $view->type != $this->t('Default')) {
      if ($view->type == $this->t('Overridden')) {
        $element['extra_actions']['#links']['revert'] = array(
          'title' => $this->t('Revert view'),
          'href' => "admin/structure/views/view/{$view->id()}/revert",
          'query' => array('destination' => "admin/structure/views/view/{$view->id()}"),
        );
      }
      else {
        $element['extra_actions']['#links']['delete'] = array(
          'title' => $this->t('Delete view'),
          'href' => "admin/structure/views/view/{$view->id()}/delete",
        );
      }
    }

Is that possible?

dawehner’s picture

+++ b/core/modules/views_ui/lib/Drupal/views_ui/ViewEditFormController.php
@@ -679,6 +679,10 @@ public function renderDisplayTop(ViewUI $view) {
+        'delete' => array(
+          'title' => $this->t('Delete view'),
+          'href' => "admin/structure/views/view/{$view->id()}/delete",
+        ),

What about checking access via the ViewAccessController ?

olli’s picture

StatusFileSize
new1.14 KB
new2.36 KB
PASSED: [[SimpleTest]]: [MySQL] 58,750 pass(es).
[ View ]

That is a good idea.

dawehner’s picture

Status:Needs review» Reviewed & tested by the community
Issue tags:+Novice, +Needs screenshots

Thank you. This is looking great. I guess some screenshots would be cool.

alexpott’s picture

Status:Reviewed & tested by the community» Needs work
Issue tags:+Needs issue summary update

As well as screenshots it'b be nice to have an issue summary without a todo :)

damiankloip’s picture

StatusFileSize
new140.2 KB

Here is a screenshot.

The only issue I can see is that if we come to the delete form this way and cancel, we will end back up on the view list page and not the view we were editing.

Screen_Shot_2013-09-09_at_15.08.11.png

damiankloip’s picture

Issue summary:View changes

add

dawehner’s picture

Status:Needs work» Reviewed & tested by the community

Thank you for the screenshot!

As well as screenshots it'b be nice to have an issue summary without a todo :)

That is not fair ... the original issue summary had a TODO, the current one don't have one anymore. :P

alexpott’s picture

Status:Reviewed & tested by the community» Fixed

Committed 742908a and pushed to 8.x. Thanks!

Automatically closed -- issue fixed for 2 weeks with no activity.

Anonymous’s picture

Issue summary:View changes

blub