Opened 17 years ago
Closed 17 years ago
#2315 closed defect (wontfix)
blocked_by returns too many tickets
Reported by: | anonymous | Owned by: | Noah Kantrowitz |
---|---|---|---|
Priority: | high | Component: | MasterTicketsPlugin |
Severity: | critical | Keywords: | |
Cc: | Trac Release: | 0.10 |
Description
I have ticket 7,17 and 18. 18 blocks 17. If I call blocked_by in util.py passing 7 as ticket id, I receive the info that 18 blocks 7.
This is related to the SQL query SELECT ticket FROM ticket_custom
WHERE name='blocking' AND (value LIKE '%7,%' OR value LIKE '%7')
That should probably be replaced by
SELECT ticket FROM ticket_custom
WHERE name='blocking' AND (value='7' OR value LIKE '%,7,%' OR value LIKE '7,%' OR value LIKE '%,7')
Leading to the following python code
cursor.execute('SELECT ticket FROM ticket_custom WHERE name=%s AND (value=%s OR value LIKE %s OR value LIKE %s OR value LIKE %s)',
('blocking', '%s'%tkt, '%s,%%'%tkt, '%%,%s,%%'%tkt, '%%,%s'%tkt))
This change fixed the problem here. Don't know if there is any side effect
Regards Philippe
The 0.10 version is entirely unmaintained. Please use the 0.11 version.