Problem/Motivation

This structure of the render array returned from EntityListBuilder::render() was changed in #1798332: Add paging to the EntityListBuilder and we didn't fix any of the child classes. Over time, almost all subclasses of EntityListBuilder have been changed and fixed, except:

Proposed resolution

Change where needed ::render() method on EntityListBuilder subclasses to reflect the change that occurred in the parent class

This is the result of the patch for ImageStyleListBuilder:

Comments

willzyx’s picture

StatusFileSize
new834 bytes

I think adding a test for this is unnecessary, but let me know

tim.plunkett’s picture

I think this might be a more widespread problem, seems like NodeTypeListBuilder has the same bug. Might as well make the same fix everywhere?

tim.plunkett’s picture

Title: Wrong message if no Image styles are available » Subclasses of EntityListBuilder incorrectly override the #empty message
Component: image.module » configuration entity system
Status: Needs review » Needs work

This structure was changed in #1798332: Add paging to the EntityListBuilder and we didn't fix any of the child classes.

willzyx’s picture

@tim.plunkett for NodeTypeListBuilder there is #2473215: Wrong text if no content types are available. The only classes that should be fixed are ActionListBuilder NodeTypeListBuilder and ImageStyleListBuilder. I checked the other EntityListBuilder classes and they seem ok.

tim.plunkett’s picture

Well they could be merged... and we could stop using urlGenerator and just use Url::fromRoute(), and we could have consistent tests.

willzyx’s picture

Status: Needs work » Needs review
StatusFileSize
new1.96 KB

addressing 5. Included ActionListBuilder in the patch and use Url::fromRoute() instead of urlGenerator.

willzyx’s picture

Issue summary: View changes

Update IS

tim.plunkett’s picture

StatusFileSize
new3.31 KB
new2.31 KB

We can then remove a ton of boilerplate!

willzyx’s picture

much better! :)
and the same thing could be done in NodeTypeListBuilder..

willzyx’s picture

Issue summary: View changes
willzyx’s picture

@tim.plunkett can we mark this as RTBC?

tim.plunkett’s picture

Since #2473215: Wrong text if no content types are available was knocked back, can we please combine them and fix all of the subclasses of EntityListBuilder at once?

alexpott’s picture

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

We should add some tests here.

alexpott’s picture

Status: Needs work » Needs review
StatusFileSize
new4.14 KB
new843 bytes
new843 bytes

Here's a test for image styles.

The last submitted patch, 14: 2490290.14-test-only.patch, failed testing.

willzyx’s picture

do we need test also for ActionListBuilder? actions list without configurable actions (means no user module installed), don't seems to be realistic

willzyx queued 14: 2490290.14.patch for re-testing.

willzyx queued 14: 2490290.14.patch for re-testing.

mile23’s picture

mile23’s picture

StatusFileSize
new1.23 KB
new2.05 KB
new5.36 KB

Added a test for the current behavior of ActionListBuilder.

The last submitted patch, 20: 2490290_20-test-only.patch, failed testing.

tim.plunkett’s picture

Status: Needs review » Needs work
  1. +++ b/core/modules/action/src/Tests/ActionListTest.php
    @@ -0,0 +1,42 @@
    +  function testEmptyActionList() {
    

    public

  2. +++ b/core/modules/action/src/Tests/ActionListTest.php
    @@ -0,0 +1,42 @@
    +    $this->drupalLogin(
    +      $this->drupalCreateUser(array('administer actions'))
    +    );
    

    One line. Might as well use []

  3. +++ b/core/modules/action/src/Tests/ActionListTest.php
    @@ -0,0 +1,42 @@
    +    entity_delete_multiple('action', array_keys($actions));
    

    Deprecated, do not use.

  4. +++ b/core/modules/action/src/Tests/ActionListTest.php
    @@ -0,0 +1,42 @@
    +  }
    +}
    

    Missing blank line

mile23’s picture

Status: Needs work » Needs review
StatusFileSize
new5.52 KB
new2.17 KB

Addressing the issues in #22.

willzyx queued 23: 2490290_23.patch for re-testing.

Status: Needs review » Needs work

The last submitted patch, 23: 2490290_23.patch, failed testing.

willzyx’s picture

StatusFileSize
new5.56 KB

Rerolled

willzyx’s picture

Status: Needs work » Needs review
willzyx’s picture

StatusFileSize
new5.56 KB
new669 bytes

Replaced the @url placeholders with :url placeholder.
Since @Mile23 added test coverage for ActionListBuilder, I think that this is ready to go

Version: 8.0.x-dev » 8.1.x-dev

Drupal 8.0.6 was released on April 6 and is the final bugfix release for the Drupal 8.0.x series. Drupal 8.0.x will not receive any further development aside from security fixes. Drupal 8.1.0-rc1 is now available and sites should prepare to update to 8.1.0.

Bug reports should be targeted against the 8.1.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.2.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

willzyx’s picture

StatusFileSize
new4.57 KB

Rerolled for 8.2. I have removed the test coverage for the empty text on the image styles page contained in the previous patch since test coverage for this was added in #2633644: Correct empty text does not display when there are no image styles

willzyx’s picture

Status: Needs review » Reviewed & tested by the community

The issue is still there after an year.. I think that this is ready to go

  • catch committed f37eba6 on 8.3.x
    Issue #2490290 by willzyx, Mile23, alexpott, tim.plunkett: Subclasses of...

  • catch committed 6154353 on 8.2.x
    Issue #2490290 by willzyx, Mile23, alexpott, tim.plunkett: Subclasses of...
catch’s picture

Committed/pushed to 8.3.x and cherry-picked to 8.2.x. Thanks

Should be fine for 8.1.x but sending for re-test.

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 30: subclasses_of-2490290-30.patch, failed testing.

  • catch committed 28a7bb1 on 8.1.x
    Issue #2490290 by willzyx, Mile23, alexpott, tim.plunkett: Subclasses of...
willzyx’s picture

Status: Needs work » Fixed

Status: Fixed » Closed (fixed)

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