Changeset 1385 for trunk


Ignore:
Timestamp:
08/17/15 17:37:32 (9 years ago)
Author:
nanardon
Message:

Remove user/aliases reference to alias object
Fix mapping value when calling attribute formating

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

Legend:

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

    r1315 r1385  
    166166} 
    167167 
     168sub set_fields { 
     169    my ($self, %data) = @_; 
     170 
     171    if ($data{forward}) { 
     172        $data{forward} = ref $data{forward} 
     173            ? $data{forward} 
     174            : [ $data{forward} ]; 
     175    } 
     176 
     177    $self->SUPER::set_fields(%data); 
     178} 
     179 
    168180 
    1691811; 
  • trunk/LATMOS-Accounts/lib/LATMOS/Accounts/Bases/Sql/User.pm

    r1372 r1385  
    302302            }, 
    303303            aliases   => { 
    304                 reference => 'aliases', 
     304                #reference => 'aliases', 
    305305                formtype => 'TEXT', 
    306306                multiple => 1, 
  • trunk/LATMOS-Accounts/lib/LATMOS/Accounts/Bases/Sql/objects.pm

    r1380 r1385  
    194194        $_ =~ /^exported$/ and $data{$_} = $data{$_} ? 1 : 0; 
    195195        my $formatted = ref($data{$_}) 
    196             ? map { $attr->input($_) } @{ $data{$_} } 
     196            ? [ map { $attr->input($_) } @{ $data{$_} } ] 
    197197            : $attr->input($data{$_}); 
    198         if ($attr->{inline}) { 
     198        if ($attr->{inline} && ! $attr->{delayed}) { 
    199199            $first{$_} = $formatted; 
    200200        } else { 
     
    203203    } 
    204204    $first{$class->_key_field} = $id; 
     205 
     206    my $lastid; 
     207    { 
     208        my $sthnextval = $base->db->prepare_cached("select nextval('ikey_seq') as c"); 
     209        $sthnextval->execute; 
     210        $lastid = $sthnextval->fetchrow_hashref()->{c}; 
     211        $first{ikey} = $lastid; 
     212    } 
    205213 
    206214    my $sth = $base->db->prepare( 
     
    214222    $sth->execute(map { $first{$_} || undef } sort keys %first) or return; 
    215223 
    216     my $lastid = $base->db->last_insert_id(undef, undef, $class->_object_table, undef); 
    217224    my $sthid = $base->db->prepare_cached( 
    218225        sprintf(q{select %s as k from %s where ikey = ?}, 
Note: See TracChangeset for help on using the changeset viewer.