Taxonomy term ordering on node view & edit not consistent with taxonomy weight

Created on 2 June 2010, over 14 years ago
Updated 25 August 2023, about 1 year ago

Problem/Motivation

Taxonomy is listed according to field delta and not the weight assigned in taxonomy admin screens. This is inconsistent and (I believe) is wrong for a number of reasons. These are:

  • Allowing taxonomy admins to order tags in the administration theme implies this will have an effect. For nodes with vocab fields using the autocomplete term widget it never does – for the other form elements available (eg. select list) it does but only after the node is re-saved.
  • The order in which terms are listed on edit and view is inconsistent – if the autocomplete term is used terms are listed in the order entered by the node creator/editor – for the other options they are list in order of weight at the time of content creation.
  • Other CMS's free tagging systems obey alphabetical order – I believe this is natural for free tagging and we are now making this impossible to achieve with vanilla Drupal where as it was out-of-the-box with D6.

Steps to reproduce

In order to recr

  1. Create an article type node with "mongoose, zebra, aardvark" in the free tagging field and save
  2. View the node... the order is "mongoose, zebra, aardvark"
  3. Go to the taxonomy list screen for the default vocab you will see that the terms are in alphabetical order
  4. Change it to any other order (except the order entered in the field) e.g. Zebra, Mongoose, Aardvark
  5. Go back to the created article - you will see it has no effect

Proposed resolution

TBD

Remaining tasks

Decide if the node view should order the terms by weigth

User interface changes

API changes

Data model changes

Release notes snippet

🐛 Bug report
Status

Needs work

Version

11.0 🔥

Component
Taxonomy 

Last updated 1 day ago

  • Maintained by
  • 🇺🇸United States @xjm
  • 🇬🇧United Kingdom @catch
Created by

🇬🇧United Kingdom alexpott 🇪🇺🌍

Live updates comments and jobs are added and updated live.
  • Needs tests

    The change is currently missing an automated test that fails when run with the original code, and succeeds when the bug has been fixed.

  • Usability

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

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.

  • 🇳🇿New Zealand quietone New Zealand

    I tested this on Drupal 11.x, standard install and I was able to reproduce some of the problem

    1. Create an article type node with "mongoose, zebra, aardvark" in the free tagging field and save
    2. View the node... the order is "aardvark, zebra, mongoose" (i.e. the reverse order to which the terms are entered). This is not longer true. The tags are in the order entered.
    3. Go to the taxonomy list screen for the default vocab you will see that the terms are in alphabetical order
    4. Change it to any other order (except the order entered in the field) eg. Zebra, Mongoose, Aardvark
    5. Go back to the created article - you will see it has no effect

    So the issue is now that when viewing a node, the order of the tags is not the same as the ordering of the vocabulary.

    I am updating the steps to reproduce

Production build 0.71.5 2024