Problem/Motivation

During the fast development of views to d8 some parts of the UI didn't got converted, because there hasn't been tests for that small feature and you shouldn't drop backward compability layers without it.

Proposed resolution

This issue fixes the linking to other displays UI and adding tests for it.

Original report by [username]

// Text of original report here.
(for legacy issues whose initial post was not the issue summary)

C:\xampp\htdocs\views\lib\Drupal\views\Plugin\views\display\DisplayPluginBase.php
    1227        $link_display = empty($this->view->display[$display_id]) ? t('None') : check_plain($this->view->display[$display_id]['display_title']);
2 matches in C:\xampp\htdocs\views\lib\Drupal\views\Plugin\views\display\DisplayPluginBase.php
Files: 
CommentFileSizeAuthor
#20 drupal-1810816-20.patch4.22 KBdamiankloip
PASSED: [[SimpleTest]]: [MySQL] 50,824 pass(es).
[ View ]
#17 drupal-1810816-17.patch4.23 KBdawehner
PASSED: [[SimpleTest]]: [MySQL] 48,305 pass(es).
[ View ]
#15 durpal-1810816-15.patch4.07 KBdawehner
FAILED: [[SimpleTest]]: [MySQL] 48,077 pass(es), 103 fail(s), and 55 exception(s).
[ View ]
#12 1810816-12.patch4.78 KBdamiankloip
FAILED: [[SimpleTest]]: [MySQL] 46,319 pass(es), 75 fail(s), and 39 exception(s).
[ View ]
#8 1810816-8.patch4.75 KBdamiankloip
PASSED: [[SimpleTest]]: [MySQL] 46,422 pass(es).
[ View ]
#6 1810816-6.patch4.59 KBfastangel
PASSED: [[SimpleTest]]: [MySQL] 46,075 pass(es).
[ View ]
#4 1810816-4.patch4.36 KBdamiankloip
PASSED: [[SimpleTest]]: [MySQL] 3,204 pass(es).
[ View ]
#4 interdiff.txt1.44 KBdamiankloip
#2 views-1810816-1-tests.patch2.22 KBdawehner
FAILED: [[SimpleTest]]: [MySQL] 3,158 pass(es), 2 fail(s), and 0 exception(s).
[ View ]
#2 views-1810816-2.patch3.14 KBdawehner
FAILED: [[SimpleTest]]: [MySQL] 3,159 pass(es), 1 fail(s), and 0 exception(s).
[ View ]
#1 views-1810816-1.patch943 bytesdawehner
PASSED: [[SimpleTest]]: [MySQL] 3,128 pass(es).
[ View ]

Comments

Status:Active» Needs review
StatusFileSize
new943 bytes
PASSED: [[SimpleTest]]: [MySQL] 3,128 pass(es).
[ View ]

Patches!

StatusFileSize
new3.14 KB
FAILED: [[SimpleTest]]: [MySQL] 3,159 pass(es), 1 fail(s), and 0 exception(s).
[ View ]
new2.22 KB
FAILED: [[SimpleTest]]: [MySQL] 3,158 pass(es), 2 fail(s), and 0 exception(s).
[ View ]

Here are tests + the fix

Status:Needs review» Needs work

The last submitted patch, views-1810816-2.patch, failed testing.

Status:Needs work» Needs review
StatusFileSize
new1.44 KB
new4.36 KB
PASSED: [[SimpleTest]]: [MySQL] 3,204 pass(es).
[ View ]

This should fix the tests.

Project:Views» Drupal core
Version:8.x-3.x-dev» 8.x-dev
Component:Code» views.module
Status:Needs review» Needs work
Issue tags:+Needs reroll

Status:Needs work» Needs review
StatusFileSize
new4.59 KB
PASSED: [[SimpleTest]]: [MySQL] 46,075 pass(es).
[ View ]

I attached one patch with the reroll.

+++ b/core/modules/views/lib/Drupal/views/Tests/UI/DisplayTest.phpundefined
@@ -55,7 +55,7 @@ public function testRemoveDisplay() {
+    $this->assertTrue($this->xpath('//div[contains(@class, views-display-deleted-link)]'), 'Make sure the display link is marked as to be deleted.');

This is still wrong, assertTrue on $this->xpath is ALWAYS true. It's asserting a constant, not a string, and should use replacement. Something like

$element = $this->xpath("//a[contains[@class, :class)]', array(':class' => 'views-display-deleted-link'));
$this->assertTrue(!empty($element), 'Make sure...');

+++ b/core/modules/views/lib/Drupal/views/Tests/UI/DisplayTest.phpundefined
@@ -181,4 +181,26 @@ public function testDisplayPluginsAlter() {
+    // Link

Needs a real comment.

StatusFileSize
new4.75 KB
PASSED: [[SimpleTest]]: [MySQL] 46,422 pass(es).
[ View ]

I think we should also assert the xpath against the actual link we deleted the display for and not just that we have that class.

Added the comment too.

Status:Needs review» Reviewed & tested by the community

+++ b/core/modules/views/lib/Drupal/views/Tests/UI/DisplayTest.phpundefined
@@ -182,4 +183,26 @@ public function testDisplayPluginsAlter() {
+    // The form redirects to the master display.
+    $this->drupalGet($path);
...
+    // The form redirects to the master display.
+    $this->drupalGet($path);

We maybe should open an follow up on that, #1826358: Redirect the user to the active editing display after saving.

#8: 1810816-8.patch queued for re-testing.

Status:Reviewed & tested by the community» Needs work

This needs a re-roll.

Status:Needs work» Needs review
StatusFileSize
new4.78 KB
FAILED: [[SimpleTest]]: [MySQL] 46,319 pass(es), 75 fail(s), and 39 exception(s).
[ View ]

Rerolled, thanks again Tim! (That damn views UI patch) ;)

Status:Needs review» Needs work

The last submitted patch, 1810816-12.patch, failed testing.

Status:Needs work» Needs review
StatusFileSize
new4.07 KB
FAILED: [[SimpleTest]]: [MySQL] 48,077 pass(es), 103 fail(s), and 55 exception(s).
[ View ]

Just a rerole.

Status:Needs review» Needs work

The last submitted patch, durpal-1810816-15.patch, failed testing.

Status:Needs work» Needs review
StatusFileSize
new4.23 KB
PASSED: [[SimpleTest]]: [MySQL] 48,305 pass(es).
[ View ]

Much better this time.

The good parts of views, if something fails then it fails everywhere :)

This could use something resembling a summary. :)

Updated.

StatusFileSize
new4.22 KB
PASSED: [[SimpleTest]]: [MySQL] 50,824 pass(es).
[ View ]

Rerolled.

Status:Needs review» Reviewed & tested by the community

This has been RTBC before, thanks for the rerole!

Status:Reviewed & tested by the community» Fixed

Committed/pushed to 8.x, thanks!

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

Issue summary:View changes

Updated