[freeside-commits] branch master updated. d8305ea9c9b9cf2b05b20b22ebffc087ef2d16c9
Ivan
ivan at 420.am
Fri Jul 10 18:24:14 PDT 2015
The branch, master has been updated
via d8305ea9c9b9cf2b05b20b22ebffc087ef2d16c9 (commit)
from 5b193ee2c5fae0743699adb1a28591f2a1735eb7 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit d8305ea9c9b9cf2b05b20b22ebffc087ef2d16c9
Author: Ivan Kohler <ivan at freeside.biz>
Date: Fri Jul 10 18:24:13 2015 -0700
fix ticket queries (whew, that was super tedious to track down), RT#13852
diff --git a/rt/lib/RT/Tickets.pm b/rt/lib/RT/Tickets.pm
index e349518..1c01fee 100755
--- a/rt/lib/RT/Tickets.pm
+++ b/rt/lib/RT/Tickets.pm
@@ -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;
}
-----------------------------------------------------------------------
Summary of changes:
rt/lib/RT/Tickets.pm | 32 +++++++++++++++++++-------------
1 file changed, 19 insertions(+), 13 deletions(-)
More information about the freeside-commits
mailing list