Reported over at #647936-5: Further improve the download UI on project pages -- splitting to a separate issue:

Looking at the project page of Devel, I noticed that the development snapshots are not shorted basing on the Drupal version with which are compatible.

I am not sure if I should report this here, as this is a report about improving the download UI; I apologize if this is not the right place.

I put this in the code:

  // version_api_tid
  if (module_exists('taxonomy')) {
    $vocabulary = taxonomy_vocabulary_load(_project_release_get_api_vid());
    $data['project_release_nodes']['version_api_tid'] = array(
      // We don't want to use the vocabulary name in the title here, since
      // that will show up in the labels of exported views and get confusing.
      'title' => t('API compatibility term'),
      'help' => t('The term from the %vocabulary vocabulary for this release.', array('%vocabulary' => $vocabulary->name)),
      'field' => array(
        'handler' => 'project_release_handler_field_version_api_tid',
        'click sortable' => TRUE,
      ),
      'filter' => array(
        'handler' => 'project_release_handler_filter_version_api_tid',
      ),
      'sort' => array(
        // TODO: Add a custom handler that can sort by taxonomy weight?
        'handler' => 'views_handler_sort',
      ),
      'argument' => array(
        'handler' => 'views_handler_argument_numeric',
      ),
      'relationship' => array(
        'base' => 'term_data',
        'field' => 'tid',
        // Again, dynamic labels here make exported views yucky.
        'label' => t('API compatibility term'),
      ),
    );
  }

Note the "TODO" next to the sort handler ;) But yeah, this is a bug... I actually have a better idea on how to solve it than I originally feared when writing that TODO. It might be possible to solve this just by clicking it together in the views UI. Stay tuned.

CommentFileSizeAuthor
#1 648322-1.download_table_sort_by_api.patch1.34 KBdww

Comments

dww’s picture

Status: Active » Needs review
StatusFileSize
new1.34 KB

This should be all we need, except I uncovered a bug in views. ;)

#648438: Relationship aliases not recorded, leading to bogus JOINs when adding certain sorts

dww’s picture

Status: Needs review » Fixed

Now that views 6.x-2.8 is out, committed and deployed:

http://drupal.org/project/devel

Status: Fixed » Closed (fixed)

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