Modify

Opened 9 years ago

Closed 8 years ago

Last modified 8 years ago

#213 closed defect (fixed)

[PATCH] 0.9 doesnt work as is

Reported by: tyardley Owned by: jornh
Priority: normal Component: PlannedMilestonesMacro
Severity: normal Keywords:
Cc: Trac Release:

Description

IFNULL doesnt exist in postgres, so that errors. This way is more portable I believe. Also, the method used to fetch rows returns a tuple.. so that has been corrected as well.

--- PlannedMilestones.py.orig   2006-03-09 18:40:39.000000000 -0600
+++ PlannedMilestones.py        2006-03-09 18:37:17.000000000 -0600
@@ -10,7 +10,7 @@
     query = "SELECT name, due, description FROM milestone " \
             "WHERE name != '' " \
             "AND (due IS NULL OR due = 0 OR due > %d) " \
-            "ORDER BY (IFNULL(due, 0) = 0) ASC, due ASC, name" % time()
+            "ORDER BY (due IS NULL) ASC, due ASC, name" % time()

     cursor = db.cursor()
     cursor.execute(query)
@@ -19,9 +19,9 @@
         row = cursor.fetchone()
         if not row:
             break
-        name = row['name']
-        if row['due'] > 0:
-            date = strftime('%x', localtime(row['due']))
+        name = row[0]
+        if row[1] > 0:
+            date = strftime('%x', localtime(row[1]))
         else:
             date = "<i>(later)</i>"
         if name == "":

Attachments (0)

Change History (1)

comment:1 Changed 8 years ago by mgood

  • Resolution set to fixed
  • Status changed from new to closed

(In [796]) * use the Milestone model API to be cross-DB compatible and preserve proper sorting (fixes #158, #213, #235, #398)

  • use Markup to make sure HTML is properly escaped for output

Add Comment

Modify Ticket

Action
as closed .
The resolution will be deleted. Next status will be 'reopened'.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.