[Rt-commit] rt branch, 4.0/jointransactions, created. rt-4.0.0-180-g83d7239

Alex Vandiver alexmv at bestpractical.com
Wed May 4 15:14:50 EDT 2011


The branch, 4.0/jointransactions has been created
        at  83d7239cb64594ccb3cf3911567e73d551293f10 (commit)

- Log -----------------------------------------------------------------
commit 83d7239cb64594ccb3cf3911567e73d551293f10
Author: Alex Vandiver <alexmv at bestpractical.com>
Date:   Thu Apr 28 18:02:00 2011 -0400

    Work around RT::Tickets->Limit not actually doing limiting
    
    Without this, the JoinTransactions called from a RT::Tickets object
    method fails to apply the ObjectType limit.  This is both incorrect, and
    means that the query does not use the appropriate index on Transactions.
    
    This happens beacause RT::Tickets->Limit does not actual limiting, but
    attempts to transform its arguments to Restrictions, to TicketSQL, to
    actual limits.  Somewhere along the way, the ObjectType gets silently
    lost.

diff --git a/lib/RT/SearchBuilder.pm b/lib/RT/SearchBuilder.pm
index b4d1698..b652d6d 100644
--- a/lib/RT/SearchBuilder.pm
+++ b/lib/RT/SearchBuilder.pm
@@ -105,9 +105,8 @@ sub JoinTransactions {
         TABLE2 => 'Transactions',
         FIELD2 => 'ObjectId',
     );
-    $self->Limit(
+    $self->RT::SearchBuilder::Limit(
         LEFTJOIN => $alias,
-        ALIAS    => $alias,
         FIELD    => 'ObjectType',
         VALUE    => ref $self->NewItem,
     );

-----------------------------------------------------------------------


More information about the Rt-commit mailing list