Update DecayingModelController.php

Found a bug importing DecayingModels to a new instance that hinders the Decaying Model Mapping with attribute types
pull/8973/head
Daniele Cantarini 2023-03-21 14:17:29 +01:00 committed by GitHub
parent ce0c79f7f7
commit 1b6ce3bf4b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

View File

@ -55,9 +55,9 @@ class DecayingModelController extends AppController
$json['org_id'] = $this->Auth->user()['org_id'];
$attribute_types = array();
if (!empty($json['attribute_types'])) {
$attribute_types = $json['attribute_types'];
unset($json['attribute_types']);
if (!empty($json['DecayingModel']['attribute_types'])) {
$attribute_types = $json['DecayingModel']['attribute_types'];
unset($json['DecayingModel']['attribute_types']);
}
if ($this->DecayingModel->save($json)) {