Problem/Motivation

Sorting the list of entity types alphabetically would help with managing the module.

Remaining tasks

Review, merge.

User interface changes

List of entity types sorted alphabetically in conditional fields config screen.

CommentFileSizeAuthor
#4 cf-before-list.png22.22 KBjesus_md
#4 cf-after-list.png22.22 KBjesus_md
Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

mortona2k created an issue. See original summary.

mortona2k’s picture

Status: Active » Needs review
jesus_md’s picture

StatusFileSize
new22.22 KB
new22.22 KB

Confirmed and tested.

Without the MR, the list at /admin/structure/conditional_fields follows the entity type machine names, so the labels come out in an odd order: "Content" ends up after "Custom menu link", and "URL alias" comes before "Shortcut link". With the MR applied it's alphabetical by label. uasort() keeps the keys, so each link still goes to the right bundle list. Casting the label to string means it sorts on the translated label.

Tested on:

  • Drupal 11.4.5, PHP 8.5
  • conditional_fields 4.x at 48be41ce with MR !123

Before:

before picture

After:

after picture

jesus_md’s picture

Status: Needs review » Reviewed & tested by the community