MT#7493 API: Preserve int. prefs on update

Don't clear internal preferences when doing a PUT on preferences.
gjungwirth/voicemail_number
Andreas Granig 12 years ago
parent 5b8d597dc3
commit 86e422bea8

@ -327,10 +327,17 @@ sub update_item {
return;
}
# make sure to not clear any internal prefs
$full_rs = $full_rs->search({
'attribute.internal' => 0,
},{
join => 'attribute',
});
if($replace) {
# in case of PUT, we remove all old entries
try {
$full_rs->delete;
$full_rs->delete_all;
} catch($e) {
$c->log->error("failed to clear preferences for '$accessor': $e");
$self->error($c, HTTP_INTERNAL_SERVER_ERROR, "Internal Server Error.");

Loading…
Cancel
Save