Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0038354Openbravo ERPA. Platformpublic2018-04-12 15:562022-02-01 08:08
JONHM 
Triage Platform Base 
highminoralways
acknowledgedopen 
5
 
 
Core
No
0038354: Different string sorting between application and export to spreadsheet process
There are some differences by sorting formatted strings between application and export to spreadsheet process.
Open 'Business Partner' window and create new business partners. Enter the same values in search key and commercial name:

|100030|50|30
|100030|50|30|100
|100030|50|30|200
|100030|50|300

Those id's are sorted in that order on the application, but when exporting to spreadsheet the sort is different:

|100030|50|30
|100030|50|300
|100030|50|30|100
|100030|50|30|200
No tags attached.
Issue History
2018-04-12 15:56JONHMNew Issue
2018-04-12 15:56JONHMAssigned To => platform
2018-04-12 15:56JONHMModules => Core
2018-04-12 15:56JONHMTriggers an Emergency Pack => No
2018-05-03 12:00alostaleNote Added: 0104229
2018-05-03 14:06alostaleNote Edited: 0104229bug_revision_view_page.php?bugnote_id=0104229#r17078
2018-05-03 14:06alostaleStatusnew => acknowledged
2018-05-03 14:07alostaleNote Added: 0104233
2018-05-03 14:07alostaleTypedefect => design defect
2022-02-01 08:08alostaleAssigned Toplatform => Triage Platform Base

Notes
(0104229)
alostale   
2018-05-03 12:00   
(edited on: 2018-05-03 14:06)
When SmartClient receives datasource data, it sorts it again in client side (see ResultSet._handleNewData function) if the data for the applied filters fit in a single page. This ensures same sorting is visualized both when retrieving data from backend and when sorting small datasets in client-side.

The problem is, depending on the locales, JavaScript and SQL sorting can differ with some special characters: in this case | is placed before numeric characters in JavaScript but afterwards in SQL.

On the other hand, generating CSV is a backend operation so JavaScript sorting is not taken into account.

(0104233)
alostale   
2018-05-03 14:07   
Moving to design defect: there is no a simple solution for this issue. Keeping consistency for all cases between server and client side sorting would require to implement in both places the exact same sorting algorithm taking into consideration different locales.