Add back ability to sort on vocabulary weight and name

Created on 23 October 2012, about 12 years ago
Updated 26 February 2024, 10 months ago

This is a follow-up from #1552396: Convert vocabularies into configuration β†’

from /core/modules/taxonomy/lib/Drupal/taxonomy/Plugin/views/filter/TaxonomyIndexTid.php

value_form()

        $options = array();
        $query = db_select('taxonomy_term_data', 'td');
        //$query->innerJoin('taxonomy_vocabulary', 'tv', 'td.vid = tv.vid');
        $query->fields('td');
        // @todo Sorting on vocabulary weight and name. 
        //$query->orderby('tv.weight');
        //$query->orderby('tv.name');
        $query->orderby('td.weight');
        $query->orderby('td.name');
        $query->addTag('term_access');
        if ($this->options['limit']) {
          $query->condition('td.vid', $vocabulary->id());
        }
        $result = $query->execute();
        foreach ($result as $term) {
          $options[$term->tid] = $term->name;
        }
πŸ“Œ Task
Status

Needs work

Version

11.0 πŸ”₯

Component
TaxonomyΒ  β†’

Last updated 2 minutes ago

  • Maintained by
  • πŸ‡ΊπŸ‡ΈUnited States @xjm
  • πŸ‡¬πŸ‡§United Kingdom @catch
Created by

πŸ‡«πŸ‡·France andypost

Live updates comments and jobs are added and updated live.
  • Usability

    Makes Drupal easier to use. Preferred over UX, D7UX, etc.

  • Regression

    It restores functionality that was present in earlier versions.

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024