fix: [decaying:import] Correctly remove id, uuid and preserve the import

data
pull/5032/head
mokaddem 2019-09-06 15:42:52 +02:00
parent 21b2da356e
commit 0d0002ee70
No known key found for this signature in database
GPG Key ID: 164C473F627A06FA
1 changed files with 5 additions and 4 deletions

View File

@ -66,10 +66,11 @@ class DecayingModelController extends AppController
throw new MethodNotAllowedException(__('Error while decoding JSON'));
}
unset($json['DecayingModel']['id']);
$json['DecayingModel']['default'] = 1;
$json['DecayingModel']['org_id'] = $this->Auth->user()['org_id'];
unset($json['id']);
unset($json['uuid']);
$json['default'] = 0;
$json['org_id'] = $this->Auth->user()['org_id'];
if ($this->DecayingModel->save($json)) {
$this->Flash->success(__('The model has been imported.'));
} else {