Re: superfluous query for ticket links for merged ticket id's
Shawn Moore <[email protected]> Tue, 23 Feb 2016 13:23:31 -0500
| Newsgroups | gmane.comp.bug-tracking.request-tracker.devel |
|---|---|
| Message-ID | <[email protected]> |
On 2016年2月18日 at 9:12:02, Christian Loos ([email protected]) wrote: > Hi, Hi Chris, > if you merge ticket 2 into 1, all links are moved from ticket 2 to 1 [1]. > If you later query ticket 1 for linked tickets, the link query limits by > the ticket id and RT::Ticket->Merged [2], which starts a query for > tickets that are merged into this ticket [3]. > > As ticket links are moved on merge, limit the RT::Ticket->_Links also by > merged ticket id's looks unnecessary for me. I think you’re right. The code to consult merged tickets for links was added first, in 2002, here: https://github.com/bestpractical/rt/commit/6020dac5c3487e41eb9a0a5203a617f9793e8c61#diff-07fe0337ce0b1c48d62516cb36bb3e33R2205 The code to move links on merge was added later, in 2003: https://github.com/bestpractical/rt/commit/53ea76636e0e288bdebf2f9a6cdac63bdce8ef47#diff-07fe0337ce0b1c48d62516cb36bb3e33R2814 I suspect the latter change indeed made the former obsolete, but since it wasn’t breaking anything, no one ever toucheed it. I too think we can remove it. > Chris > > [1] https://github.com/bestpractical/rt/blob/stable/lib/RT/Ticket.pm#L1849 > [2] https://github.com/bestpractical/rt/blob/stable/lib/RT/Ticket.pm#L1751 > [3] https://github.com/bestpractical/rt/blob/stable/lib/RT/Ticket.pm#L1751 Thanks! Shawn --------- RT 4.4 and RTIR Training Sessions (http://bestpractical.com/services/training.html) * Hamburg Germany - March 14 & 15, 2016 * Washington DC - May 23 & 24, 2016