From aeac2e9f27f9d58c1f50c376fa0bf7a329858ff0 Mon Sep 17 00:00:00 2001 From: laoneo Date: Tue, 26 Apr 2016 08:22:47 +0200 Subject: [PATCH] Load the types form when the data is an array --- administrator/components/com_fields/models/field.php | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/administrator/components/com_fields/models/field.php b/administrator/components/com_fields/models/field.php index bd2cf93b33a2f..e1357774dafc0 100644 --- a/administrator/components/com_fields/models/field.php +++ b/administrator/components/com_fields/models/field.php @@ -343,14 +343,19 @@ protected function preprocessForm (JForm $form, $data, $group = 'content') { $component = $parts[0]; - if (isset($data->type)) + $dataObject = $data; + if (is_array($dataObject)) { - $this->loadTypeForms($form, $data->type, $component); + $dataObject = (object) $dataObject; + } + if (isset($dataObject->type)) + { + $this->loadTypeForms($form, $dataObject->type, $component); $form->setFieldAttribute('type', 'component', $component); // Not alowed to change the type of an existing record - if ($data->id) + if ($dataObject->id) { $form->setFieldAttribute('type', 'readonly', 'true'); }