Ticket #26 (defect)

Opened 4 years ago

Last modified 4 years ago

Due dates sort backwards

Status: closed (fixed)

Reported by: lolindrath@gmail.com Assigned to: bsag
Priority: normal Milestone: Version 1.02
Component: Coding Version: 1.02
Severity: normal Keywords: due date sort
Cc:

Looking at the example data, the task due on 3/12/05 is sorted before the task on 3/11/05.

The fix (also attached as a patch file): <% @not_done = Todo.find_all("done=0 AND context_id=#{@shown_place.id}", "ISNULL(due), due ASC, created ASC") %>

The ISNULL() is to force NULLs to sort towards the bottom (stole this from a MySql? board).

I also had to fix the test data for mysql since all the due dates in there were 0000-00-00 instead of NULL. In the current version of tracks (58) it fills in blank due dates with NULL so that isn't an issue. Patch Attached.

Attachments

date_sort.patch (0.5 kB) - added by anonymous on 04/07/05 19:56:44.
date_sort_db.patch (4.3 kB) - added by lolindrath@gmail.com on 04/07/05 19:57:07.
the db fix for this bug

Change History

04/07/05 19:56:44: Modified by anonymous

  • attachment date_sort.patch added.

04/07/05 19:57:07: Modified by lolindrath@gmail.com

  • attachment date_sort_db.patch added.

the db fix for this bug

04/07/05 20:50:24: Modified by bsag

  • status changed from new to closed.
  • resolution set to fixed.
  • description changed.

Whoa! Excellent trick, lolindrath! That's been puzzling me for a while. Applied the patches in [59]. Thanks!

04/07/05 20:58:25: Modified by lolindrath@gmail.com

I wasn't able to check in Postgres or SQLite but I'm pretty sure ISNULL() is part of the ANSI standard.