[rt-users] Bug when returning count of tickets found with querybuilder

Schultz, Eric ESchultz at corp.untd.com
Thu Jan 26 16:31:34 EST 2006


My temporary solution was this (there has to be something better):

in lib/RT/Tickets_Overlay.pm, modify sub CountAll, and replace:

    $self->_ProcessRestrictions() if ( $self->{'RecalcTicketLimits'} ==
1 );
    return ( $self->SUPER::CountAll() );

with:

    my $i = 0;
    while ($self->Next) {
        $i++;
    }
    return $i;

Next() does the right thing checking for privs and whatnot (same thing
that share/html/Elements/TicketList does to actually spit out the rows
to screen).  Since the work is already done in TicketList (I took out
the call to CountAll there since it was redundant now), it's a shame we
need to still call CountAll in Results.html, repeating the work.
Obviously can't pass it backward from TicketList to Results.html, and
still need to iterate through the ticket $Collection to get the records
to print in TicketList.  If anyone has a better idea, I'd be glad to
hear it :-)

> -----Original Message-----
> From: rt-users-bounces at lists.bestpractical.com 
> [mailto:rt-users-bounces at lists.bestpractical.com] On Behalf 
> Of Schultz, Eric
> Sent: Thursday, January 26, 2006 12:20 PM
> To: rt-users at lists.bestpractical.com
> Subject: [rt-users] Bug when returning count of tickets found 
> with querybuilder
> 
> Say there are two queues, A and B.  Say I have 
> SeeQueue/ShowTicket/etc.
> rights on queue A, but no rights at all on queue B.  Say there are 2
> tickets in each queue that have the subject "testing".
> 
> If I do a query for the subject "testing", then click "Search", I will
> get two result rows for queue A, and none for queue B, as would be
> expected.  But at the top of the page, it tells me "Found 4 tickets".
> If I was running as the superuser, I would see that there are indeed 4
> tickets, and get all four result rows.
> 
> This appears to be a problem both in the 3.4.x and the 3.5.x code.
> 
> Eric Schultz



More information about the rt-users mailing list