craftcms / craftcms/cms

[3.x]: Project.yaml sorting is odd

Open
#12,710 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug craft3
Dominant language
PHP
Stars
3.6k
Forks
705
Avg merge
1d 5h
Merged PRs (30d)
134

Description

What happened?
Description

We're seeing some weird behavior where sorting is not being treated as numeric hex values but as string/hex hybrids, and this leading zero is not taken into account

image
Steps to reproduce
  1. Create a field with a hex value that starts with a leading zero
  2. See where it's sorted within the project.yaml file
Expected behavior
  1. We'd see this sorted with similar other leading zero hex values
Actual behavior
  1. We see this sorted as though the leading zero isn't there
Craft CMS version

3.7.65.2

PHP version

7.4.33

Operating system and version

No response

Database type and version

No response

Image driver and version

No response

Installed plugins and versions

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the issue by creating a field with a leading-zero hex value and inspecting its position in project.yaml. Trace the code responsible for sorting that file, then verify that leading-zero hex values are ordered numerically with comparable values rather than as strings.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.