Problem/Motivation
When adding a new view (/admin/structure/views/add) I have to select a base table from a list (labeled "Show:"). The default, "Content", is appropriate, but the other options can be overwhelming. It would help if they were sorted.
See the "User interface changes" section for a screenshot from the Standard profile. On a moderately complicated site, it can be much worse.
Steps to reproduce
- Visit
/admin/structure/views/add.
- Open the Select list labeled "Show:".
- Note that the options are not in any particular order.
Proposed resolution
After #3065903: Add label sort ability to Select element, it is very easy to sort the options in a Select list. Just add '#sort_options' => TRUE, to the right form element in Drupal\views_ui\ViewAddForm.
Remaining tasks
User interface changes
Before:

After:

API changes
None
Data model changes
None
Release notes snippet
N/A
Comments
Comment #2
benjifisherI believe that the test coverage in #3065903: Add label sort ability to Select element is good enough that we can just use the new
sort_optionsattribute here without adding any new tests.Comment #3
adityasingh commentedJust add
'#sort_options' => TRUE,Sort the options in a Select list. Please review.
Comment #4
benjifisher@adityasingh:
According to your profile, you have 19 issue credits in the last year, including 4 for Drupal core. I tagged this issue "Novice" so that a new contributor could learn how to work on an issue without needing a lot of expertise. Do you still consider yourself a novice? Did you learn anything while working on this issue?
Comment #5
abhijith s commentedApplied patch #3 and it works fine.The list labelled Show is sorted now in the views.
Adding screenshots below
Before patch:


After patch:
Comment #6
abhijith s commentedComment #7
adityasingh commentedHi benjifisher
I am not sure about novice definition but absolutely this is minor issue, will take care in future.
Thanks.
Comment #8
ishanmahajan commentedHi @benjifisher:
I am slightly uncomfortable with this line of questioning, towards an individual's choice of contribution. One should not have to declare their expertise level or mention what they "learned" while contributing to our community.
As a community, we welcome all contributions, no matter how simple or complex they are. My last core contribution was a link to India's constitution, on a Core issue discussing wether we include "Caste" in the Drupal code of conduct or no. It took me 5 minutes and I did NOT learn anything new, but I believe it helped make progress.
Sometimes one may choose to pick a simple issue as that is all they can afford to pick, in the limited time that they volunteer towards open source.
Please don't get me wrong, I would also like new contributors to get the opportunity to work on novice issues. But personally, I am not in favor of discouraging others who may feel more comfortable with Novice issues. As how would you judge a newcomer? I have been on D.O for over 10 years and can probably not submit a patch more complex than what this issue warranted. Coding is not what I do professionally.
If you still feel strongly about this, I will recommend you open an issue to update the contribution guide and the issue etiquettes page to put guidelines around who should pick Novice issue, and see if the larger community feels the same way as you.
Questioning an individual on their choice of contribution, feels like gatekeeping to me.
Thank you for hearing me out and thanks for all your contributions.
Comment #9
quietone commented@adityasingh, just in case you haven't found it yet the explanation, such as it is, for the tags, including 'Novice' are at Issue tags -- special tags. There may be more elaborate descriptions elsewhere but I like the concise definition that tag page offers.
Comment #10
volkswagenchickThis discussion appears to discourage contribution from some participants. It can also discourage folks that are new to a topic or concept from speaking up or reaching out for help. Consider providing the new contributor with links to help them learn the topic or concept. ( issue queue etiquette and tags)
For more information, please refer to Drupal’s Values and Principles #3 of fostering a learning environment: long-term contributors should be role models by admitting their own shortcomings and mistakes, being vulnerable, and by giving others the same respect that was once given to them.
Principle #9 can also be useful here: be constructively honest, and relentlessly optimistic. You can be optimistic and supportive by giving suggestions for how to improve their contributions. By being helpful, you encourage people to accept feedback and act on it.
https://www.drupal.org/about/values-and-principles
This comment is provided as a service (currently being tested) of the Drupal Community Health Team as part of a project to encourage all participants to engage in positive discourse. For more information, please visit https://www.drupal.org/project/drupal_cwg/issues/3129687
Comment #11
benjifisherThanks for the feedback, @ishanmahajan and @volkswagenchick. From now on, when I add an issue specifically for first-time contributors, I will say so in a comment rather than rely on the Novice tag.
Now that the Novice task has been done, I am removing the tag.
+1 for RTBC.
Comment #12
benjifisherWhen I created this issue, I looked for existing issues, but I guess I did not look hard enough: this issue is a duplicate of #2932016: Entity names in the 'add view' form are unsorted.
The approach used in this issue, taking advantage of #3065903: Add label sort ability to Select element, is simpler than the approach used in the other issue. Most of the effort in the other issue is for the related test. As I said in #1 here,
If no one objects, then I will close the other issue as a duplicate and transfer the issue credits to this one.
Comment #21
alexpottCrediting people from #3065903: Add label sort ability to Select element
Comment #22
alexpottThis is a UX bug.
Committed and pushed 84b1d18bfc to 9.2.x and 6ab8e5e693 to 9.1.x. Thanks!
Comment #25
benjifisherSorry, I never followed up on my suggestion.
Correction: the credits added to this issue were transferred from #2932016: Entity names in the 'add view' form are unsorted.