X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=rt%2Flib%2FRT%2FTickets.pm;h=4002b30d6586b8034aa4b6e1a58fb973de88d5cf;hb=44dd00a3ff974a17999e86e64488e996edc71e3c;hp=e349518a59cf41ecb449fd7a4d814699a8dbc0b0;hpb=026dc7ad72ba972f230b6709e31fa64397d75ad4;p=freeside.git diff --git a/rt/lib/RT/Tickets.pm b/rt/lib/RT/Tickets.pm index e349518a5..4002b30d6 100755 --- a/rt/lib/RT/Tickets.pm +++ b/rt/lib/RT/Tickets.pm @@ -2,7 +2,7 @@ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2019 Best Practical Solutions, LLC # # # (Except where explicitly superseded by other copyright notices) @@ -1494,12 +1494,12 @@ sub JoinToCustLinks { TABLE2 => 'Links', FIELD2 => 'LocalBase', ); - $self->SUPER::Limit( - LEFTJOIN => $linkalias, - FIELD => 'Base', - OPERATOR => 'LIKE', - VALUE => 'fsck.com-rt://%/ticket/%', - ); + $self->SUPER::Limit( + LEFTJOIN => $linkalias, + FIELD => 'Base', + OPERATOR => 'LIKE', + VALUE => 'fsck.com-rt://%/ticket/%', + ); $self->SUPER::Limit( LEFTJOIN => $linkalias, FIELD => 'Type', @@ -1617,6 +1617,7 @@ sub JoinToCustomerViaService { sub _FreesideFieldLimit { my ( $self, $field, $op, $value, %rest ) = @_; + my $is_negative = 0; if ( $op eq '!=' || $op =~ /\bNOT\b/i ) { # if the op is negative, do the join as though @@ -1650,7 +1651,7 @@ sub _FreesideFieldLimit { # if it's compound, create a join from cust_main or cust_svc to that # table, using custnum or svcnum, and Limit on that table instead. - my @_SQLLimit = (); + my @Limit = (); foreach my $a (@alias) { if ( $table2 ) { $a = $self->Join( @@ -1680,8 +1681,8 @@ sub _FreesideFieldLimit { # will produce a subclause: "cust_main_1.custnum IS NOT NULL OR # cust_main_2.custnum IS NOT NULL" (or "IS NULL AND..." for a negative # query). - #$self->_SQLLimit( - push @_SQLLimit, { + #$self->Limit( + push @Limit, { %rest, ALIAS => $a, FIELD => $pkey, @@ -1693,11 +1694,16 @@ sub _FreesideFieldLimit { }; } - $self->_OpenParen; - foreach my $_SQLLimit (@_SQLLimit) { - $self->_SQLLimit( %$_SQLLimit); + + #the clauses seem to now auto-paren themselves (correctly!), calling this + # inserts "( )" which causes the query to syntax error out + #$self->_OpenParen; + + foreach my $Limit (@Limit) { + $self->Limit( %$Limit); } - $self->_CloseParen; + + #$self->_CloseParen; }