[Rt-commit] rt branch, 4.0/autocomplete-exclude, created. rt-4.0.10-90-g7115dc4

Kevin Falcone falcone at bestpractical.com
Thu Mar 14 19:45:14 EDT 2013


The branch, 4.0/autocomplete-exclude has been created
        at  7115dc41a582ef07c81e3be999e8a3150f34b6d2 (commit)

- Log -----------------------------------------------------------------
commit 7115dc41a582ef07c81e3be999e8a3150f34b6d2
Author: Kevin Falcone <falcone at bestpractical.com>
Date:   Thu Mar 14 19:27:53 2013 -0400

    Exclude wasn't working with more than one record
    
    This was generating (id != 7 OR id != 9) which gleefully returns both 7
    and 9. Switch over to an ENTRYAGGREGATOR of AND. This is exposed in the
    Membership page of Groups. Groups with one user had that user excluded
    from the member autocomplete, but as soon as you have two members that
    stopped working (same for groups).

diff --git a/share/html/Helpers/Autocomplete/Groups b/share/html/Helpers/Autocomplete/Groups
index c505b0b..b6a6f1a 100644
--- a/share/html/Helpers/Autocomplete/Groups
+++ b/share/html/Helpers/Autocomplete/Groups
@@ -77,7 +77,7 @@ $groups->Limit(
 
 # Exclude groups we don't want
 foreach (split /\s*,\s*/, $exclude) {
-    $groups->Limit(FIELD => 'id', VALUE => $_, OPERATOR => '!=');
+    $groups->Limit(FIELD => 'id', VALUE => $_, OPERATOR => '!=', ENTRYAGGREGATOR => 'AND');
 }
 
 my @suggestions;
diff --git a/share/html/Helpers/Autocomplete/Users b/share/html/Helpers/Autocomplete/Users
index 7a3bb32..349442a 100644
--- a/share/html/Helpers/Autocomplete/Users
+++ b/share/html/Helpers/Autocomplete/Users
@@ -111,7 +111,7 @@ while (my ($name, $op) = each %fields) {
 
 # Exclude users we don't want
 foreach (split /\s*,\s*/, $exclude) {
-    $users->Limit(FIELD => 'id', VALUE => $_, OPERATOR => '!=');
+    $users->Limit(FIELD => 'id', VALUE => $_, OPERATOR => '!=', ENTRYAGGREGATOR => 'AND');
 }
 
 my @suggestions;

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


More information about the Rt-commit mailing list