Problem/Motivation
While it appears as though the Administer -> Reports -> Field list hasn't turned into a view yet (I'm assuming this is non-trivial given that there's no native support for creating a view of fields), we should still find a way to make it more usable, whether we do this through Views or not.
For example, I'd like to be able to do the following:
- Sort by field type.
- Filter by field type.
- Increase the number of items on each page.
I found a contrib module that looks like it handles the filtering: Filter Field List
Proposed resolution
Creating a form with two filters by entity_type and field_type.
Remaining tasks
Write patch
Code review
A11Y review
UX Review
Commit
User interface changes
Added two select lists, Entity type and Field type on the admin/reports/fields page
API changes
None
Data model changes
None
Comment | File | Size | Author |
---|---|---|---|
#56 | Screenshot 2023-01-30 at 18.03.53.jpg | 253.31 KB | markconroy |
#56 | Screenshot 2023-01-30 at 18.03.37.jpg | 151.39 KB | markconroy |
Issue fork drupal-2959299
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
colanComment #4
joshua.boltz CreditAttribution: joshua.boltz commentedEvery time I use the field report, I think to myself exactly this issue. Glad it’s in the works.
Comment #5
artemboikoI have added filters for entity type and field type. I tried to add sorting functionality in getEntityIds() of FieldStorageConfigListBuilder but seems like QueryInterface tableSort doesn't work with this type of entities.
Comment #6
artemboikoComment #8
artemboikoPrevious patch is wrong.
I have fixed it and updated it to the latest version of core 8.8.x-dev
Comment #9
andypostComment #10
artemboikoI have added new patch with small fixes of code standards.
@andypost could you clarify what should be done in scope of tag needs change record ?
Comment #11
colanPlease provide interdiffs to make it easier for reviewers.
Comment #12
andypost@artemboiko That's a way to announce changes https://www.drupal.org/contributor-tasks/draft-change-record
So when patch commited everyone will get notification
Also more about tags you can find in
Issue tags
description in sidebar block about issue stateComment #13
volegerInterdiffs for:
Comment #14
artemboikoThanx @voleger.
I've updated tests for checking that two form elements with needed options are exist. And I've added code for testing submit form and filtering of results. Also, I've created change record.
Pls review @andypost @colan.
What is the next step?
Comment #15
artemboikoComment #16
volegerTo improve DX change the type of the parameter from the
array
to<ProperInterface>[]
.Also, update return type of the method from
array
tostring[]
to show the type of the elements of the array.The same as 1.
The same as 1.
Comment #17
artemboikoThanx @voleger.
Added this changes.
Comment #18
artemboikoComment #19
artemboikoComment #20
artemboikoComment #21
volegerMuch better, set to RTBC
Comment #22
colanJust catching up on this now, sorry.
Wouldn't it be better to turn this page into a view? I believe all we've done here is hard-code the additional functionality instead of:
...just like the Users page (except that we have to add the first step above because these aren't entities).
Comment #23
artemboiko@colan
Yes It would be great and I investigated it.
But views designed to work with entities and their database table. I mean user entity has it’s own table in db. In our case field_storage_config is stored in one table with other configs. So for implementing it with views we need to write tons of harcode. And I am not sure that it will work right.
Correct me if I am wrong.
Comment #24
andypost@colan Nice idea, there was 2 attempts to add additional backends for config entities
- https://www.drupal.org/project/efq_views
- https://www.drupal.org/project/config_views
Sadly both looks forgotten so at this stage we can just improve UI a bit by hardcoding filters into list builder
in summary not clear why list_builder no longer used and new form object added
docs
why it is not list builder like "draggable" one we have for vocabularies
Comment #25
colanWell, thanks for looking into it. Yes, let's just continue with what we're doing here.
Comment #26
artemboiko@andypost please check, I have added form to the list_builder.
Comment #27
artemboikoComment #28
andypostLooks great, but now a question of tests!
Views integration needs separate issue, I bet one exists in efq/config-views contrib
Comment #29
artemboikoComment #30
idebr CreditAttribution: idebr at iO commentedClosed #3054321: Filters on top of the field list report page. as a duplicate issue.
Comment #32
couloir007 CreditAttribution: couloir007 commentedHas anyone applied this to 8.8?
Comment #33
Vinodhini.E CreditAttribution: Vinodhini.E at UniMity Solutions Pvt Limited commentedI have applied patch #17, It's working for me.
I am attaching a screenshot after applying a patch.
Comment #34
jungleRerolled from #27
Comment #36
Hardik_Patel_12 CreditAttribution: Hardik_Patel_12 at QED42 for Drupal India Association commentedRe-rolling patch against 9.1.x-dev , kindly review a patch.
Comment #39
raman.b CreditAttribution: raman.b at OpenSense Labs commentedAnother re-roll. Also addressing failed test cases, handling deprecations and fixing some CS issues
Comment #40
ranjith_kumar_k_u CreditAttribution: ranjith_kumar_k_u at Zyxware Technologies commentedThe above patch works fine ,it creates two select box filters Entity type , Field type and also the filters works fine.
Before patch
After patch
RTBC
Comment #41
ranjith_kumar_k_u CreditAttribution: ranjith_kumar_k_u at Zyxware Technologies commentedComment #42
catch#39 is still failing tests.
We should open a follow-up for views support and conversion, looks like https://www.drupal.org/project/config_views has some work towards this.
Comment #43
raman.b CreditAttribution: raman.b at OpenSense Labs commentedResolving rest of the deprecations
Comment #45
Bohus UlrychFYI I was not able to use patch #43 with D9.2.1
Composer failed with
Could not apply patch! Skipping. The error was: Cannot apply patch https://www.drupal.org/files/issues/2020-12-18/2959299-43.patch
Then I tried to patch it manually:
patching file core/modules/field_ui/src/FieldStorageConfigListBuilder.php
Hunk #4 succeeded at 90 with fuzz 2 (offset 2 lines).
Hunk #5 succeeded at 113 (offset 2 lines).
Hunk #6 succeeded at 193 (offset 2 lines).
patching file core/modules/field_ui/tests/src/Functional/ManageFieldsFunctionalTest.php
Hunk #1 FAILED at 752.
1 out of 1 hunk FAILED -- saving rejects to file core/modules/field_ui/tests/src/Functional/ManageFieldsFunctionalTest.php.rej
Thanks
Comment #47
vikashsoni CreditAttribution: vikashsoni as a volunteer and at Zyxware Technologies commentedApplied patch #10 working fine and applied successfully
After patch file exposed filters added successfully
Thanks for the patch ....
Comment #50
ifrikPatch #43 fails to apply for Drupal 10.1.x
Comment #52
ifrikComment #53
ifrikComment #54
ifrikThis might not be as configurable as a view would be, but it will already help a lot with sitebuilding and with checking module upgrades, by reducing the very long list of fields on more complex sites.
This page is not used by content editor etc. on a production site, but purely a reference used in the development and maintenance of the site, so adding these filters is not breaking any customized functionality.
Comment #55
smustgrave CreditAttribution: smustgrave at Mobomo commented@vikashsoni why did you test #10?
Seems issue is being addressed in MR but have CI failures
Hiding files to avoid confusion and noise.
Comment #56
markconroy CreditAttribution: markconroy at Annertech commentedThis is looking good to me and works as expected, however I don't know enough to mark it RTBC.
With the latest commit passing, I'll set it to needs review for now.
Before:
After:
Comment #57
smustgrave CreditAttribution: smustgrave at Mobomo commentedLeft some comments on the MR.
Also the CR will need some updates.
don't think that needs to be included in the CR.
CR doesn't mention the new parameter needed.
CR could use some before/after screenshots.
Comment #58
ifrikI'm happy to continue working on this. But what is "CR"?
Comment #59
andypostCR ist change record, the way to add it is https://www.drupal.org/node/add/changenotice?field_project=3060&field_is...