my $props = delete($params->{config_values}) || { };
my $is_new = !$params->{id};
+ # Assign empty arrays if the browser doesn't send those controls.
+ $params->{clients} ||= [];
+ $params->{groups} ||= [];
+
$self->user($is_new ? SL::DB::AuthUser->new : SL::DB::AuthUser->new(id => $params->{id})->load)
->assign_attributes(%{ $params })
->config_values({ %{ $self->user->config_values }, %{ $props } });
my $params = delete($::form->{client}) || { };
my $is_new = !$params->{id};
+ # Assign empty arrays if the browser doesn't send those controls.
+ $params->{groups} ||= [];
+ $params->{users} ||= [];
+
$self->client($is_new ? SL::DB::AuthClient->new : SL::DB::AuthClient->new(id => $params->{id})->load)->assign_attributes(%{ $params });
my @errors = $self->client->validate;
my $params = delete($::form->{group}) || { };
my $is_new = !$params->{id};
+ # Assign empty arrays if the browser doesn't send those controls.
+ $params->{clients} ||= [];
+ $params->{users} ||= [];
+
$self->group($is_new ? SL::DB::AuthGroup->new : SL::DB::AuthGroup->new(id => $params->{id})->load)->assign_attributes(%{ $params });
my @errors = $self->group->validate;