[rt-devel] superfluous query for ticket links for merged ticket id's

Shawn Moore shawn at bestpractical.com
Tue Feb 23 13:23:31 EST 2016

On 2016年2月18日 at 9:12:02, Christian Loos (cloos at netcologne.de) 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:


The code to move links on merge was added later, in 2003:


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


More information about the rt-devel mailing list