[freeside-commits] branch FREESIDE_3_BRANCH updated. 7d6a2e0b66cc0c3f5ff7187bafb1d6e8fb1db525

Mark Wells mark at 420.am
Thu Apr 7 12:55:44 PDT 2016


The branch, FREESIDE_3_BRANCH has been updated
       via  7d6a2e0b66cc0c3f5ff7187bafb1d6e8fb1db525 (commit)
      from  cd7e557dcface9adc5d0058c6722f37915bff44d (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 7d6a2e0b66cc0c3f5ff7187bafb1d6e8fb1db525
Author: Mark Wells <mark at freeside.biz>
Date:   Thu Apr 7 12:55:11 2016 -0700

    fix inexact lookup of tickets by customer + id, #39536, from #13852

diff --git a/rt/lib/RT/Tickets.pm b/rt/lib/RT/Tickets.pm
index c826b6f..af6b6ed 100755
--- a/rt/lib/RT/Tickets.pm
+++ b/rt/lib/RT/Tickets.pm
@@ -2277,7 +2277,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(
@@ -2307,8 +2307,12 @@ 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, {
+      # This requires the ENTRYAGGREGATOR to be OR for positive queries
+      # (where a matching customer exists), but ONLY between these two
+      # constraints and NOT with anything else in the query, hence the
+      # subclause.
+
+      push @Limit, {
           %rest,
           ALIAS           => $a,
           FIELD           => $pkey,
@@ -2320,11 +2324,10 @@ sub _FreesideFieldLimit {
       };
     }
 
-    $self->_OpenParen;
-    foreach my $_SQLLimit (@_SQLLimit) {
-      $self->_SQLLimit( %$_SQLLimit);
+    foreach (@Limit) {
+      # _SQLLimit would force SUBCLAUSE to 'ticketsql'; bypass it
+      $self->SUPER::Limit( %$_ );
     }
-    $self->_CloseParen;
 
 }
 

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

Summary of changes:
 rt/lib/RT/Tickets.pm |   17 ++++++++++-------
 1 file changed, 10 insertions(+), 7 deletions(-)




More information about the freeside-commits mailing list