diff --git a/app/Model/Attribute.php b/app/Model/Attribute.php index 3c4de8b4f..efe3e2f4e 100644 --- a/app/Model/Attribute.php +++ b/app/Model/Attribute.php @@ -3138,6 +3138,9 @@ class Attribute extends AppModel if (!isset($options['decayingModel'])) { $options['decayingModel'] = false; } + if (!isset($options['modelOverrides'])) { + $options['modelOverrides'] = array(); + } if (!isset($options['excludeDecayed'])) { $options['excludeDecayed'] = 0; } else { diff --git a/app/Model/DecayingModel.php b/app/Model/DecayingModel.php index b1c628e6e..db31ba28e 100644 --- a/app/Model/DecayingModel.php +++ b/app/Model/DecayingModel.php @@ -166,7 +166,11 @@ class DecayingModel extends AppModel public function isDefaultModel($decaying_model) { - return !is_null($decaying_model['DecayingModel']['uuid']); + if (isset($decaying_model['DecayingModel']['uuid'])) { + return !is_null($decaying_model['DecayingModel']['uuid']); + } else { + return false; + } } public function isEditableByCurrentUser($user, $decaying_model) @@ -482,9 +486,9 @@ class DecayingModel extends AppModel $models = $this->fetchModels($user, $associated_model_ids, false, array('enabled' => true)); } } elseif (is_array($model_id)) { - $models = $this->fetchModels($user, $model_id, false, array('enabled' => true)); + $models = $this->fetchModels($user, $model_id, false, array()); } else { - $models[] = $this->fetchModel($user, $model_id, false, array('enabled' => true)); + $models[] = $this->fetchModel($user, $model_id, false, array()); } foreach ($models as $i => $model) {