#2336 - [ocPortal 9]Catalogs Don't Sort Correctly
| Identifier | #2336 |
|---|---|
| Issue type | Minor issue (breaks specific functionality) |
| Title | [ocPortal 9]Catalogs Don't Sort Correctly |
| Status | Closed (cannot reproduce) |
| Handling member | Chris Graham |
| Addon | catalogues |
| Description | This issue is in regards to ocPortal version 9 series - I do not know if it still exists in Composr, but since I didn't have the option to choose ocPortal...
Anyway, in the Catalogs feature of ocPortal 9, you can set a field to sort by ascending or descending order. I've done this with the cost field, wanting to sort things in order from lowest price to highest price. It sorts fine if the prices are the same amount of digits, 2 numbers each price for example. But, if the price has three numbers in it when the other prices have 2 numbers in them, it places that 3 number price at the top of the list despite it being a higher price. A screenshot is supplied showing this in action. |
| Steps to reproduce | Make a catalog with a price, cost, or some other number field. Have that field be the sort field with either ascending or descending sort order. Make a few entries with similar numbers of digits for that field Make another entry with one more digit for that field. See the sort order now messed up. |
| Funded? | No |
The system will post a comment when this issue is modified (e.g., status changes). To be notified of this, click "Enable comment notifications".
Comments
(Click to enlarge)
My best guess is that you're on an older version with a sorting bug that forces it into non-DB sorting, which would likely be doing a string sort rather than an integer sort.
But I checked the code carefully, and I don't think this could happen on the latest code.
(Click to enlarge)