Changeset 2264


Ignore:
Timestamp:
06/19/19 10:52:53 (5 years ago)
Author:
nanardon
Message:

Fix otheraddress attribute issue

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/LATMOS-Accounts-Web/lib/LATMOS/Accounts/Web/Controller/Users.pm

    r2259 r2264  
    230230    my $base = $c->model('Accounts')->db; 
    231231 
    232     $c->stash->{address} = $base->get_object('address', $arg); 
    233     $c->stash->{form} = $c->model('AttrForms', 'address', 
    234         $c->stash->{address}); 
    235     $c->stash->{form}->set_attrs; 
     232    if ($c->stash->{address} = $base->get_object('address', $arg)) { 
     233        $c->stash->{form} = $c->model('AttrForms', 'address', 
     234            $c->stash->{address}); 
     235        $c->stash->{form}->set_attrs; 
     236    } 
    236237} 
    237238 
  • trunk/LATMOS-Accounts-Web/lib/LATMOS/Accounts/Web/Model/AttrForms.pm

    r2256 r2264  
    299299    $new->{form} = $form; 
    300300    $new->{object} = $object if (ref $object); 
    301     $new->{base} = $base || (ref $object ? $object->base : undef) or return $self; 
     301    $new->{base} = $base || (ref $object ? $object->base : $c->model('Accounts')->db); 
    302302    $new->{otype} = ref $object ? $object->type : $object; 
    303303 
  • trunk/LATMOS-Accounts/lib/LATMOS/Accounts/Bases/Attributes.pm

    r2262 r2264  
    4545    $attr_info->{_otype}      = $otype; 
    4646    $attr_info->{monitored} ||= $base->config('monitored')->{ lc( $otype . '.' . $attributes ) }; 
    47     $attr_info->{ro}          = 1 if ($attr_info->{auto}); 
     47    $attr_info->{ro}          = 1 if ($attr_info->{auto}          && !defined($attr_info->{ro})); 
     48    $attr_info->{hide}        = 1 if ($attr_info->{_name} =~ /^_/ && !defined($attr_info->{hide})); 
    4849 
    4950    return bless($attr_info, $class); 
  • trunk/LATMOS-Accounts/lib/LATMOS/Accounts/Bases/Sql/User.pm

    r2262 r2264  
    10701070            otheraddress => { 
    10711071                ro => 1, 
    1072                 auto => 1, 
    1073             }, 
    1074             _otheraddress => { 
    1075                 ro => 1, 
    1076                 hide => 1, 
     1072                multiple => 1, 
    10771073                reference => 'address', 
    10781074                get => sub { 
     
    11111107                }, 
    11121108            }, 
    1113             postalAddress => { auto => 1 }, 
     1109            postalAddress => { 
     1110                auto => 1, 
     1111            }, 
    11141112            _postalAddress => { 
    11151113                hide => 1, 
Note: See TracChangeset for help on using the changeset viewer.