MT#19821 subsciber profile edit drops random voip_usr_prefs

a map used by the profile_edit logic mistakenly used
  voip_subscriber_profile_attributes.id
as keys instead of
  voip_preferences.id
keys.

so editing a subscriber profile seems to drop arbitrary
voip_usr_preferences values (and also cf mappings),
even when just changing the profile's name.

in addition, the resseller_edit config option is made
working as expected.

Change-Id: I75a60ee3e1e3889bdb16ccc0fa7d5661305f351c
changes/25/6325/3
Rene Krenn 10 years ago
parent 1c2c8cf4fd
commit e8ab9036a8

@ -485,15 +485,15 @@ sub profile_edit :Chained('profile_base') :PathPart('edit') :Does(ACL) :ACLDetac
# no previous default profile, make this one default
$form->values->{set_default} = 1;
}
if($c->user->roles eq "reseller" && !$c->config->{profile_sets}->{reseller_edit}) {
# only allow generic fields to be updated
delete $form->values->{attribute};
}
$profile->update($form->values);
if($c->user->roles eq "reseller" && !$c->config->{profile_sets}->{reseller_edit}) {
# only allow generic fields to be updated
return;
}
my %old_attributes = map { $_->id => $_->attribute->attribute }
my %old_attributes = map { $_->attribute->id => $_->attribute->attribute }
$profile->profile_attributes->all;
# TODO: reuse attributes for efficiency reasons?

Loading…
Cancel
Save