Patch Trac to sort ticket version field alphabetically
()
June 8, 2011 - 16:52

This is a super simple hack that you can apply to your Trac installation to get your version selection field sorted alphabetically in the newticket form. Very trivial, but posting it to make the solution googlable for others.

Apply to:
/usr/lib/python/site-packages/Trac.egg/trac/ticket/model.py

873,874c873,874
<             return (v.time or utcmax, embedded_numbers(v.name))
<         return sorted(versions, key=version_order, reverse=True)
---
>             return (v.name.lower() or utcmax, embedded_numbers(v.name))
>         return sorted(versions, key=version_order, reverse=False)

Reply

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

More information about formatting options