Modify

Opened 7 years ago

Closed 7 years ago

#2315 closed defect (wontfix)

blocked_by returns too many tickets

Reported by: anonymous Owned by: coderanger
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

Attachments (0)

Change History (1)

comment:1 Changed 7 years ago by coderanger

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

The 0.10 version is entirely unmaintained. Please use the 0.11 version.

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.