Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
It seems that /admin/structure/views is limited on 50 items. If there are more than 50 items some items (the alphabetically last active views) are not listed.
And there is no link available to go to a 2nd page, too.
Proposed resolution
Either add a pager or show unlimited items.
Remaining tasks
User interface changes
API changes
Data model changes
Comment | File | Size | Author |
---|---|---|---|
#21 | list_views_ui-2508966-21-complete.patch | 4.29 KB | geertvd |
#21 | interdiff-2508966-17-21.txt | 701 bytes | geertvd |
#17 | list_views_ui-2508966-17-complete.patch | 4.25 KB | geertvd |
#17 | list_views_ui-2508966-17-test.patch | 1.65 KB | geertvd |
#17 | interdiff-2508966-14-17.txt | 602 bytes | geertvd |
Comments
Comment #1
tim.plunkett51 views is a lot! Good find :)
#1798332: Add paging to the EntityListBuilder always adds a pager, and if a subclass of EntityListBuilder doesn't add a #type => pager element, this will happen.
But the views listing is custom and has the separate lists of enabled and disabled, so we should opt out of paging altogether.
We should add a test to prove this works.
Comment #2
BerdirAre you sure we need this? The documentation says that NULL will disable the pager, so passing in NULL should be fine.. this might be a bit more explicit, though.
I'd use NULL here, not FALSE, don't really have a good argument though.
Comment #3
tim.plunkett1) The docs do say
If passed a false value (FALSE, 0, NULL), the pager is disabled.
, but I was just going to skip the whole thing since we can.2) What's your not-so-good argument? :)
Comment #4
BerdirThe only argument I have is that we changed quite a few API's from FALSE to NULL, entity entity load return value if it doesn't exist.
NULL is closer to none/nothing than FALSE, imho. I think FALSE should preferably only be used when it's a boolean.. TRUE or FALSE... not an actual value or nothing.
Comment #5
tim.plunkettI thought of it as "Do I want limiting? No I do not! FALSE!"
But I can switch it when I write tests.
Comment #6
giancarlosotelo CreditAttribution: giancarlosotelo at MD Systems GmbH commentedI added the test.
Comment #8
BerdirLets make the test class a bit more generic, we might want to add more tests at some point.
I was looking for an existing test where we could add this but didn't find a good one.
Maybe just ViewsListTest as class name and something like "Tests the views list" ?
Leave "Wizard" out (Wizard is the thing that allows you to create a new view, this is nothing to do with that. We're not listing wizards).
Description could be "Tests that the views list does not use a pager."?
We should be a bit more explicit here and for example explain that we have a lot more views because there are also a number of default views.
Comment #9
giancarlosotelo CreditAttribution: giancarlosotelo at MD Systems GmbH commentedUploading the patch with the changes
Comment #10
dawehnerIts a small step forward. Does someone mind open up a new issue to make views again working with a pager? I think this is what you want at the end.
Comment #11
giancarlosotelo CreditAttribution: giancarlosotelo at MD Systems GmbH commentedCreated the follow-up #2536826: Add a pager to the list of Views.
Comment #12
dawehnerThank you!
Comment #13
alexpottI think we should improve the docs to mention that FALSE should be used when the overview page has a filter on it (like the views page).
I think we should just extend WebTestBase and not have any default views get in the way. Then we can assert that we have the number of expected views.
We should document why we are doing this here.
Comment #14
giancarlosotelo CreditAttribution: giancarlosotelo at MD Systems GmbH commentedHere is the patch with the recommendations.
Comment #15
giancarlosotelo CreditAttribution: giancarlosotelo at MD Systems GmbH commentedComment #16
BerdirI don't think that test would actually fail right now? You want to have one more than 50 atleast.
Comment #17
geertvd CreditAttribution: geertvd at XIO commentedComment #19
koence CreditAttribution: koence at XIO commentedLimit has been augmented (by 1), running test does not fail.
Also, admin/structure/views/ shows more than 50 views, sorted alphabetically.
Comment #20
alexpottThis @todo should point to the followup issue. And not have a space before the fullstop.
Comment #21
geertvd CreditAttribution: geertvd at XIO commentedFixed that
Comment #22
koence CreditAttribution: koence at XIO commentedComment has been updated. Reference to the follow-up issue was added, space before the full-stop was removed.
Comment #23
alexpottCommitted 99a340d and pushed to 8.0.x. Thanks!
Fixed on commit - slightly reformated the comment. The next line in @todo's need to be indented.
Comment #24
jzech CreditAttribution: jzech at MD Systems GmbH commentedThank you for all your work on this!