In #2011006: Default local tasks provided by Views are broken, we fixed Views to distinguish between a default task and its parent when providing routes.

The Views UI listing page should also link to parent pages, not the default task.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

tim.plunkett’s picture

Status: Active » Needs review
FileSize
2.08 KB
1.15 KB

Okay, here's the fix with tests. Basically, instead of examining the display config directly, we call the pre-existing method that lets it decide what the path is.
And since we just fixed the logic of that method, everything is peachy.

tim.plunkett’s picture

FileSize
5.32 KB
5.44 KB

@damiankloip pointed me to #2012882: Move getDisplaysList() out of View storage class to ViewListController, and suggested I follow its lead. I agree.

I had to move some test coverage from ViewStorageTest to this new test method (since the view entity no longer has a method to find its displays paths).

dawehner’s picture

Nice stuff!

I try to figure out why there can't be a unit test instead and I can't think of one.

+++ b/core/modules/views_ui/lib/Drupal/views_ui/ViewListController.phpundefined
@@ -156,4 +157,31 @@ public function render() {
+          $all_paths[] = check_plain('/' . $path);

Should be String::checkPlain() now.

tim.plunkett’s picture

FileSize
3.18 KB
7.33 KB

Let's just fix the class.

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

The last submitted patch, vdc-2016939-4.patch, failed testing.

xjm’s picture

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

#4: vdc-2016939-4.patch queued for re-testing.

damiankloip’s picture

Status: Needs review » Reviewed & tested by the community

That looks good to me.

alexpott’s picture

Status: Reviewed & tested by the community » Needs work
Issue tags: +Needs reroll

Needs a reroll

curl https://drupal.org/files/vdc-2016939-4.patch | git a
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  7508  100  7508    0     0   3339      0  0:00:02  0:00:02 --:--:--  4506
error: patch failed: core/modules/views/lib/Drupal/views/Tests/ViewStorageTest.php:221
error: core/modules/views/lib/Drupal/views/Tests/ViewStorageTest.php: patch does not apply
error: patch failed: core/modules/views_ui/lib/Drupal/views_ui/ViewListController.php:2
error: core/modules/views_ui/lib/Drupal/views_ui/ViewListController.php: patch does not apply
tim.plunkett’s picture

Status: Needs work » Reviewed & tested by the community
Issue tags: -Needs reroll
FileSize
7.2 KB

Status: Reviewed & tested by the community » Needs work
Issue tags: -VDC

The last submitted patch, vdc-2016939-9.patch, failed testing.

tim.plunkett’s picture

Status: Needs work » Needs review

#9: vdc-2016939-9.patch queued for re-testing.

Status: Needs review » Needs work

The last submitted patch, vdc-2016939-9.patch, failed testing.

tim.plunkett’s picture

Status: Needs work » Needs review

#9: vdc-2016939-9.patch queued for re-testing.

Status: Needs review » Needs work

The last submitted patch, vdc-2016939-9.patch, failed testing.

pcambra’s picture

Status: Needs work » Needs review

#9: vdc-2016939-9.patch queued for re-testing.

Status: Needs review » Needs work

The last submitted patch, vdc-2016939-9.patch, failed testing.

tim.plunkett’s picture

Status: Needs work » Needs review

#9: vdc-2016939-9.patch queued for re-testing.

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

The last submitted patch, vdc-2016939-9.patch, failed testing.

dawehner’s picture

Status: Needs work » Needs review
FileSize
4.76 KB
11.97 KB

Just some additional mocking is required to add a test for that.

dawehner’s picture

FileSize
11.74 KB

Let me fix the use statements fast.

tim.plunkett’s picture

#20: vdc-2016939-20.patch queued for re-testing.

damiankloip’s picture

+++ b/core/modules/views/lib/Drupal/views/DisplayBag.phpundefined
@@ -46,7 +47,7 @@ public function __construct(ViewExecutable $view, PluginManagerInterface $manage
+    $this->instanceIDs = MapArray::copyValuesToKeys(array_keys($display));

Seems vaguely related, but ok :) These things need to be switched out anyway.

+++ b/core/modules/views_ui/lib/Drupal/views_ui/ViewListController.phpundefined
@@ -229,4 +230,31 @@ protected function getDisplaysList(EntityInterface $view) {
+   *   The view object.

The view entity ('instance' also maybe)?

+++ b/core/modules/views_ui/tests/Drupal/views_ui/Tests/ViewListControllerTest.phpundefined
@@ -69,6 +71,38 @@ public function testBuildRowEntityList() {
+

Additional space

+++ b/core/modules/views_ui/tests/Drupal/views_ui/Tests/ViewListControllerTest.phpundefined
@@ -69,6 +71,38 @@ public function testBuildRowEntityList() {
+    $container = new ContainerBuilder();
+    $executable_factory = new ViewExecutableFactory();
+    $container->set('views.executable', $executable_factory);
+    $container->set('plugin.manager.views.display', $display_manager);
+    \Drupal::setContainer($container);

We go to desperate measures to unit test a method nowadays!

+++ b/core/modules/views_ui/tests/Drupal/views_ui/Tests/ViewListControllerTest.phpundefined
@@ -98,6 +134,7 @@ public function testBuildRowEntityList() {
+    $this->assertEquals($row['data']['path'], '/test_page', 'The path of the page display is not rendered.');

I don't think this message is really what's being tested?

dawehner’s picture

The point is that the message is just shown/displayed if the test failed.

damiankloip’s picture

Yep, but it still seems like it's not really what the test is going. No rendering involved.

dawehner’s picture

If we can't come up with a better title, let's drop it?

dawehner’s picture

Issue tags: +PHPUnit
FileSize
1.47 KB
11.74 KB

Fixed the points.

tim.plunkett’s picture

Status: Needs review » Reviewed & tested by the community

Those fixes are clearer. Thanks for the awesome test!

alexpott’s picture

Status: Reviewed & tested by the community » Needs work
Issue tags: +Needs reroll

Needs a reroll..

git applyc https://drupal.org/files/vdc-2016939-26.patch
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 12022  100 12022    0     0   5341      0  0:00:02  0:00:02 --:--:--  7711
error: patch failed: core/modules/views_ui/lib/Drupal/views_ui/ViewListController.php:133
error: core/modules/views_ui/lib/Drupal/views_ui/ViewListController.php: patch does not apply
dawehner’s picture

Status: Needs work » Needs review
FileSize
11.47 KB

Rerolled.

tim.plunkett’s picture

Status: Needs review » Reviewed & tested by the community

Thanks, reroll is good.

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Committed 2f872b8 and pushed to 8.x. Thanks!

Manually tested all looks good

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