projects
/
freeside.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
1db55f4
)
fix ticket queries (whew, that was super tedious to track down), RT#13852
author
Ivan Kohler
<ivan@freeside.biz>
Sat, 11 Jul 2015 01:24:15 +0000
(18:24 -0700)
committer
Ivan Kohler
<ivan@freeside.biz>
Sat, 11 Jul 2015 01:24:15 +0000
(18:24 -0700)
rt/lib/RT/Tickets.pm
patch
|
blob
|
history
diff --git
a/rt/lib/RT/Tickets.pm
b/rt/lib/RT/Tickets.pm
index
e349518
..
1c01fee
100755
(executable)
--- a/
rt/lib/RT/Tickets.pm
+++ b/
rt/lib/RT/Tickets.pm
@@
-1494,12
+1494,12
@@
sub JoinToCustLinks {
TABLE2 => 'Links',
FIELD2 => 'LocalBase',
);
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',
$self->SUPER::Limit(
LEFTJOIN => $linkalias,
FIELD => 'Type',
@@
-1617,6
+1617,7
@@
sub JoinToCustomerViaService {
sub _FreesideFieldLimit {
my ( $self, $field, $op, $value, %rest ) = @_;
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
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.
# 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 @
_SQL
Limit = ();
+ my @Limit = ();
foreach my $a (@alias) {
if ( $table2 ) {
$a = $self->Join(
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).
# 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->
_SQL
Limit(
- push @
_SQL
Limit, {
+ #$self->Limit(
+ push @Limit, {
%rest,
ALIAS => $a,
FIELD => $pkey,
%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;
}
}