Skip to content

Sort by by custom field work incorrect for mix of positive and negative numeric values #19020

Open
@PeterKvayt

Description

@PeterKvayt

Which Umbraco version are you using?

15.3.0

Bug summary

Custom numeric properties seem to be treated as string values during ordering by them.

Specifics

Here is the uSync for reproduce the environment:

usync-export.zip

Steps to reproduce

2025-04-13.16-18-35.mp4

Expected result / actual result

We have the following values: 1, 2, 3, 4, -2, -3
Actual: asc order: 1, 2, 3, 4, -2, -3; desc order: -3, -2, 4, 3, 2, 1
Expected: asc order: -3, -2, 1, 2, 3, 4; desc order: 4, 3, 2, 1, -2, -3

P.S.: it seems this behavior caused by the following code:

Image

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions