View Issue Details

IDProjectCategoryView StatusLast Update
0012299mantisbtotherpublic2010-08-29 11:34
Reportermicahg Assigned To 
PrioritynormalSeverityfeatureReproducibilityhave not tried
Status newResolutionopen 
Product Versiongit trunk 
Summary0012299: Target Version sorting on View Issues page should be numeric, not textual
Description

Example in reproduce steps.
When sorting in version order ascending, I would expect Bug 3 to be last and it'll show up first.

Steps To Reproduce

Have at least 3 bugs with 3 different versions, one should be numerically larger, but textually smaller:
i.e.
Bug 1, Version 0.2
Bug 2, Version 0.3
Bug 3, Version 0.10

TagsNo tags attached.

Activities

atrol

atrol

2010-08-27 09:12

developer   ~0026486

Versions are stored as text, not number.
This is the only way to support also version numbering like
1.2.3 or Beta 1.1 or whatever convention is used.

You could name your versions like 0.02 , 0.03, ... 0.10 to get what you want

micahg

micahg

2010-08-27 12:30

reporter   ~0026489

That's fine, that's what PHP's natsort is for:
http://us2.php.net/natsort

atrol

atrol

2010-08-28 10:11

developer   ~0026490

AFAIK natsort can not be used for ordering in database. IMO sorting after database fetch should not be used because this would lead to performance / memory problems.

micahg

micahg

2010-08-29 00:14

reporter   ~0026497

Ok. How about sorting the version based on the release date the same way they're shown for the target version?

atrol

atrol

2010-08-29 09:05

developer   ~0026499

Ordering by something which you don't see is confusing.

Introducing a new column "target_version_date" could avoid this.
But there can be no clean solution for this, because target version is stored as character in mantis_bug_table and not as a key to mantis_project_version_table.

micahg

micahg

2010-08-29 11:34

reporter   ~0026503

The assumption is the developers will organize the releases based on the order of release, hence sorting by date should be a sensible workaround. Also, a simple join can solve the multiple table issue and if necessary, a compound key can be added to mantis_project_version_table for date, version so as to speed up queries.