From d52e0dc41f1367623f548fdfebc0118adc2cda31 Mon Sep 17 00:00:00 2001 From: Izhar Aazmi Date: Sun, 8 Jun 2014 02:54:23 +0530 Subject: [PATCH] Fixed JForm::bind for nested JObject argument JForm::bind method was relying on getProperties() which returned only the attributes of the given object. However in case one of these attributes happens to be a JObject instance itself, then JForm::bindLevel would fail there. In particular model's getItem function tends to return a nested JObject always. JArrayHelper call would take care of JObject to Array conversion recursively. --- libraries/joomla/form/form.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libraries/joomla/form/form.php b/libraries/joomla/form/form.php index 26d3dfe770574..26eceb70cd30b 100644 --- a/libraries/joomla/form/form.php +++ b/libraries/joomla/form/form.php @@ -129,8 +129,8 @@ public function bind($data) } elseif ($data instanceof JObject) { - // Handle a JObject. - $data = $data->getProperties(); + // Handle a JObject. Getting just the properties won't work. We need to convert any nested JObject too. + $data = JArrayHelper::fromObject($data); } else {