This patch catches the returning form and sorts the #options before displaying with a simple asort();

Index: /Users/jbitner/Sites/myplay/public_html/sites/all/modules/contrib/views/views_ui.module
===================================================================
--- views_ui.module	(revision 2104)
+++ views_ui.module	(working copy)
@@ -1716,6 +1716,7 @@
  * Render the add buttons for one of the dynamic sections on our form.
  */
 function views_ui_render_section_add(&$form, $items,  $label) {
+  asort($form['id']['#options']);
   foreach ($items as $item) {
     $row[] = drupal_render($form[$item], false);
   }
CommentFileSizeAuthor
#5 views.patch635 bytesmvc
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

mvc’s picture

Status: Needs review » Reviewed & tested by the community

Works perfectly for me, and makes my views far easier to edit.

JohnAlbin’s picture

Status: Reviewed & tested by the community » Active

This should be submitted as an attached patch file.

Also, the problem description is so short I don't even know what the change is supposed to accomplish.

mvc’s picture

Status: Active » Reviewed & tested by the community

@JohnAlbin: I've created a separate patch file and attached as requested.

The 'problem' is that often the views ui generates very long dropdown lists in no particular order, making it hard to find (for example) the CCK field you wish to add as a field to a view. By simply sorting the list, it becomes very easy to find a particular field.

Obviously, this isn't required for the views module to work correctly, but it makes it much simpler to use, and I don't see any reason not to add this asort.

sun’s picture

Status: Reviewed & tested by the community » Needs work

Please submit a proper patch. If you do, it has a good chance to be included in 1.7.

mvc’s picture

Status: Needs work » Reviewed & tested by the community
FileSize
635 bytes

Oops, sorry, I thought I had attached that file. Here you go.

sun’s picture

Status: Reviewed & tested by the community » Fixed

Thanks, committed.

Anonymous’s picture

Status: Fixed » Closed (fixed)

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

regx’s picture

Cool that this has been added to views. I created a small module to do this as well as add several other sort options.
The asort is the simplest and most effective for me, but I had request for several other sort methods.

Curious if anyone else finds the other sort options useful, or if I should abandon my module?
http://drupal.org/project/view_ui_sort

mroswell’s picture

Where can I find views 5.x-1.7? There's no recent dev release showing on the module page for 5.x.

sun’s picture

The development snapshot for 1.x is visible on the project page now.

mroswell’s picture

Thanks!