[3.x]: Project.yaml sorting is odd
Open
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
Steps to reproduce
- Create a field with a hex value that starts with a leading zero
- See where it's sorted within the project.yaml file
Expected behavior
- We'd see this sorted with similar other leading zero hex values
Actual behavior
- 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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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