Changeset 2273


Ignore:
Timestamp:
08/21/19 18:50:16 (5 years ago)
Author:
nanardon
Message:

Don't return related object twice

Location:
trunk/LATMOS-Accounts/lib/LATMOS/Accounts/Bases/Sql
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/LATMOS-Accounts/lib/LATMOS/Accounts/Bases/Sql/objects.pm

    r2267 r2273  
    328328 
    329329    foreach my $otype (keys %$Subotype) { 
     330        my %objectNames = (); 
    330331        foreach my $attr (ref $Subotype->{$otype} ? @{ $Subotype->{$otype} } : $Subotype->{$otype}) { 
    331332            my @list = $self->base->search_objects( $otype, $attr . '=' . $self->id ); 
    332             if (@list) { 
    333                 push(@{ $res{$otype} }, @list); 
     333            foreach (@list) { 
     334                $objectNames{ $_ } = 1; 
    334335            } 
     336        } 
     337        if (keys %objectNames) { 
     338            $res{$otype} = [ sort keys %objectNames ]; 
    335339        } 
    336340    } 
  • trunk/LATMOS-Accounts/lib/LATMOS/Accounts/Bases/Sql/upgrade.pm

    r2268 r2273  
    13521352 
    13531353    if ($self->get_global_value('NeedRecomputeObject')) { 
     1354        $self->log(LA_NOTICE, 'Object value need to be recompute, this will take a moment'); 
    13541355        foreach my $otype (qw(user)) { 
    13551356            foreach my $name ($self->listRealObjects($otype)) { 
Note: See TracChangeset for help on using the changeset viewer.