Changeset 928 for LATMOS-Accounts


Ignore:
Timestamp:
04/18/12 19:49:34 (12 years ago)
Author:
nanardon
Message:
  • fix finalpoint attribute fetching
  • handling multiple forward when fetching finalpoint attribute
File:
1 edited

Legend:

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

    r861 r928  
    110110        limit 1 
    111111        }); 
    112         my $next = $self->get_field('forward'); 
    113         while (1) { 
     112        my @res = (); 
     113        my @next = @{ $self->get_field('forward') }; 
     114        while (my $next = shift(@next)) { 
    114115            $sth->execute($next); 
    115116            if (my $res = $sth->fetchrow_hashref) { 
    116                 $next = $res->{forward}; 
    117                 $next = ref $next 
    118                     ? join(',', @$next) 
    119                     : $next; 
    120                 next; 
     117                push(@next, @{ $res->{forward} }); 
    121118            } else { 
    122                 last; 
     119                push(@res, $next); 
    123120            } 
    124121        } 
    125122        $sth->finish; 
    126         return $next; 
     123        return @res ? \@res : undef; 
    127124    } 
    128125    if ($field =~ /^(parents|anyparents|sameforward|samedestination)$/) { 
Note: See TracChangeset for help on using the changeset viewer.