[Rt-devel] PATCH: bug in Search/Bulk.html

David Schweikert dws at ee.ethz.ch
Fri Apr 28 11:36:39 EDT 2006


On Fri, Apr 28, 2006 at 11:06:39 -0400, Jesse Vincent wrote:
> > Search/Bulk.html didn't work for me and I could fix it with the
> > following (ugly) patch:
> 
> That doesn't seem quite right. Can you tell us a bit more about what you
> were seeing, bugwise, as well as what exact RT you're coming form?

Indeed the patch is not the right fix but only a workaround.
I am using RT 3.6.0pre1 and I have seen that $OrderBy is set to
something like 'id||||' which would need to be expanded, like it is in
the Elements/TicketList component:

 if ($OrderBy =~ /\|/) {
     # Multiple Sorts
     my @OrderBy = split /\|/,$OrderBy;
     my @Order = split /\|/,$Order;
     $Collection->OrderByCols(
         map { { FIELD => $OrderBy[$_], ORDER => $Order[$_] } } ( 0
         .. $#OrderBy ) );;
 } else {
     $Collection->OrderBy(FIELD => $OrderBy, ORDER => $Order);
 }

Cheers
David


> > --- share/html/Search/Bulk.html~        2006-04-28 10:13:06.521180000 +0200
> > +++ share/html/Search/Bulk.html 2006-04-28 10:07:58.576804000 +0200
> > @@ -215,7 +215,7 @@
> >  
> >  my $Tickets = RT::Tickets->new( $session{'CurrentUser'} );
> >  $Tickets->FromSQL($Query);
> > -$Tickets->OrderBy( FIELD => $OrderBy, ORDER => $Order );
> > +#$Tickets->OrderBy( FIELD => $OrderBy, ORDER => $Order );
> >  $Tickets->RowsPerPage($Rows) if ($Rows);
> >  $Tickets->GotoPage( $Page - 1 );    # SB uses page 0 as the first page
> > 
> > 
> > Apparently $OrderBy is now more complex than just a field and should be
> > handled like in Elements/TicketList.
> > 
> > Cheers
> > David
-- 
David Schweikert        | phone: +41 44 632 7019
System manager ISG.EE   | walk:  ETH Zentrum, ETL F24.1
ETH Zurich, Switzerland | web:   http://people.ee.ethz.ch/dws


More information about the Rt-devel mailing list