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:
- \Drupal\action\ActionListBuilder
- \Drupal\node\NodeTypeListBuilder (see #2473215: Wrong text if no content types are available)
- \Drupal\image\ImageStyleListBuilder
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:

| Comment | File | Size | Author |
|---|---|---|---|
| #30 | subclasses_of-2490290-30.patch | 4.57 KB | willzyx |
| #28 | interdiff.txt | 669 bytes | willzyx |
| #28 | 2490290_28.patch | 5.56 KB | willzyx |
| #26 | 2490290_26.patch | 5.56 KB | willzyx |
| #23 | interdiff.txt | 2.17 KB | mile23 |
Comments
Comment #1
willzyx commentedI think adding a test for this is unnecessary, but let me know
Comment #2
tim.plunkettI think this might be a more widespread problem, seems like NodeTypeListBuilder has the same bug. Might as well make the same fix everywhere?
Comment #3
tim.plunkettThis structure was changed in #1798332: Add paging to the EntityListBuilder and we didn't fix any of the child classes.
Comment #4
willzyx commented@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.
Comment #5
tim.plunkettWell they could be merged... and we could stop using urlGenerator and just use Url::fromRoute(), and we could have consistent tests.
Comment #6
willzyx commentedaddressing 5. Included ActionListBuilder in the patch and use Url::fromRoute() instead of urlGenerator.
Comment #7
willzyx commentedUpdate IS
Comment #8
tim.plunkettWe can then remove a ton of boilerplate!
Comment #9
willzyx commentedmuch better! :)
and the same thing could be done in NodeTypeListBuilder..
Comment #10
willzyx commentedComment #11
willzyx commented@tim.plunkett can we mark this as RTBC?
Comment #12
tim.plunkettSince #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?
Comment #13
alexpottWe should add some tests here.
Comment #14
alexpottHere's a test for image styles.
Comment #16
willzyx commenteddo we need test also for ActionListBuilder? actions list without configurable actions (means no user module installed), don't seems to be realistic
Comment #19
mile23This will need a reroll once this one lands: #2556731: Remove usage of deprecated UrlGeneratorInterface::generateFromPath() from ImageStyleListBuilder::build()
Comment #20
mile23Added a test for the current behavior of ActionListBuilder.
Comment #22
tim.plunkettpublic
One line. Might as well use []
Deprecated, do not use.
Missing blank line
Comment #23
mile23Addressing the issues in #22.
Comment #26
willzyx commentedRerolled
Comment #27
willzyx commentedComment #28
willzyx commentedReplaced the
@urlplaceholders with:urlplaceholder.Since @Mile23 added test coverage for ActionListBuilder, I think that this is ready to go
Comment #30
willzyx commentedRerolled 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
Comment #31
willzyx commentedThe issue is still there after an year.. I think that this is ready to go
Comment #34
catchCommitted/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.
Comment #37
willzyx commented