[DOCU-2089] Column sorting of long fields not working properly Created: 17/Dec/20  Updated: 12/Apr/21  Resolved: 22/Dec/20

Status: Closed
Project: Documentation
Component/s: documentation-examples
Affects Version/s: 6.2
Fix Version/s: None

Type: Improvement Priority: Neutral
Reporter: Tobias Kerschbaum Assignee: Ashraf Khamis
Resolution: Done Votes: 0
Labels: services
Remaining Estimate: Not Specified
Time Spent: 0.05d
Original Estimate: Not Specified

Attachments: File Screen Recording 2020-12-17 at 09.01.35.mov    

 Description   

Steps to reproduce

  1.  Use a content app with a column of long values
  2.  Sort des Column

(See screen recording in attachments)

Expected results

The column would be sorted in ascending or descending order.

Actual results

Somehow it seems like the long values are handled as string values. But the outcome is not completely logical or explainable. 

Workaround

I don't know any workaround which would help here.

Development notes



 Comments   
Comment by Roman Kovařík [ 17/Dec/20 ]

Could you try with 

columns:
 - name: test
   type: java.lang.Long #<<<

?

Comment by Tobias Kerschbaum [ 17/Dec/20 ]

Changing the configuration with type long as roman mentioned works fine. Could we add this somehow to the docs?

Comment by Tobias Kerschbaum [ 17/Dec/20 ]

I know it is already mentioned in the docs that it is possible to change the type of the column but Roman mentioned it would be useful to add a note that changing the type to long is a prerequisite for the correct sorting.

Comment by Ashraf Khamis [ 22/Dec/20 ]

Added the following note to the type property at https://docs.magnolia-cms.com/product-docs/Templating/Dialog-definition/Field-definition.html and https://docs.magnolia-cms.com/product-docs/Apps/App-configuration/Column-definition.html:

Make sure that type is set to a value that matches the type of data you entered (for example, java.lang.Long for long values).

Reviewed by Roman.

Generated at Mon Feb 12 01:23:57 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.