Edgewall Software

Opened 6 years ago

Last modified 4 years ago

#13078 closed defect

TicketQuery for empty field of type time is incorrect — at Initial Version

Reported by: Ryan J Ollos Owned by:
Priority: normal Milestone: 1.2.4
Component: query system Version:
Severity: normal Keywords: postgresql ticketquery
Cc: Branch:
Release Notes:
API Changes:
Internal Changes:

Description

The issue was raised in gdiscussion:trac-users:e7NvYuzgQKk. For a field of type time (e.g. duedate), [[TicketQuery(duedate=)]] does not retrn the correct results.

It looks like the following patch might work:

  • trac/ticket/query.py

    diff --git a/trac/ticket/query.py b/trac/ticket/query.py
    index c65f2bfc8..ca1f1d496 100644
    a b class Query(object):  
    510510                    col = 'c.' + db.quote(name)
    511511                value = value[len(mode) + neg:]
    512512
    513                 if name in self.time_fields:
     513                if name in self.time_fields and value:
    514514                    if '..' in value:
    515515                        (start, end) = [each.strip() for each in
    516516                                        value.split('..', 1)]

Change History (0)

Note: See TracTickets for help on using tickets.