[Rt-commit] rt branch, 4.4/search-watcher-by-group-name, repushed

? sunnavy sunnavy at bestpractical.com
Thu Jun 3 17:26:08 EDT 2021


The branch 4.4/search-watcher-by-group-name was deleted and repushed:
       was bf41df16b95d1b4d7ea1cf65693d3c6b6266c6d6
       now a08bc079243e48bafc9bc7b2c66ea4aa90b333f7

1: 1f23670e3e ! 1: 09f2808ca8 Support to search user defined group names in watcher limit
    @@ -22,7 +22,7 @@
     -    # if it's equality op and search by Email or Name then we can preload user
     +    # if it's equality op and search by Email or Name then we can preload user/group
          # we do it to help some DBs better estimate number of rows and get better plans
    -     if ( $args{OPERATOR} =~ /^!?=$/
    +     if ( $args{QUOTEVALUE} && $args{OPERATOR} =~ /^!?=$/
                   && (!$args{FIELD} || $args{FIELD} eq 'Name' || $args{FIELD} eq 'EmailAddress') ) {
     @@
                  ? ($column ? 'Load' : 'LoadByEmail')
    @@ -53,4 +53,23 @@
          }
      
          if ( $column and $args{FIELD} and $args{FIELD} eq 'id' ) {
    +@@
    +             GroupsAlias => $groups, New => 1, Left => 0
    +         );
    +         if ($args{FIELD} eq "id") {
    +-            my @ids;
    +-            if ( $is_shallow ) {
    +-                @ids = $args{VALUE};
    +-            }
    +-            else {
    ++            my @ids = ref $args{VALUE} eq 'ARRAY' ? @{ $args{VALUE} } : $args{VALUE};
    ++            if ( !$is_shallow ) {
    +                 my $groups = RT::Groups->new( RT->SystemUser );
    +                 $groups->LimitToUserDefinedGroups;
    +                 $groups->WithMember( PrincipalId => $args{VALUE}, Recursively => 1 );
    +-                @ids = ( $args{VALUE}, map { $_->id } @{ $groups->ItemsArrayRef } );
    ++                push @ids, map { $_->id } @{ $groups->ItemsArrayRef };
    +             }
    + 
    +             # Save a left join to Users, if possible
     
2: bf41df16b9 = 2: a08bc07924 Test ticket search by id/name of the group added in watchers



More information about the rt-commit mailing list