Index: Form/Element.php =================================================================== --- Form/Element.php (revision 16059) +++ Form/Element.php (working copy) @@ -749,7 +749,8 @@ public function setBelongsTo($array) { $array = $this->filterName($array, true); - if (!empty($array)) { + + if (is_string($array) && '' !== $array) { $this->_belongsTo = $array; } Index: Form/Decorator/FormElements.php =================================================================== --- Form/Decorator/FormElements.php (revision 16059) +++ Form/Decorator/FormElements.php (working copy) @@ -85,7 +85,7 @@ ->setTranslator($translator); if ($item instanceof Zend_Form_Element) { $item->setBelongsTo($belongsTo); - } elseif (!empty($belongsTo) && ($item instanceof Zend_Form)) { + } elseif ((null !== $belongsTo) && ($item instanceof Zend_Form)) { if ($item->isArray()) { $name = $this->mergeBelongsTo($belongsTo, $item->getElementsBelongTo()); $item->setElementsBelongTo($name, true); Index: Form.php =================================================================== --- Form.php (revision 16059) +++ Form.php (working copy) @@ -838,7 +838,7 @@ require_once 'Zend/Form/Exception.php'; throw new Zend_Form_Exception('Invalid name provided; must contain only valid variable characters and be non-empty'); } - + return $this->setAttrib('name', $name); } @@ -1361,7 +1361,8 @@ { $origName = $this->getElementsBelongTo(); $name = $this->filterName($array, true); - if (empty($name)) { + + if (! (is_string($name) && '' !== $name)) { $name = null; } $this->_elementsBelongTo = $name; @@ -1413,7 +1414,7 @@ { if ((null === $this->_elementsBelongTo) && $this->isArray()) { $name = $this->getName(); - if (!empty($name)) { + if (is_string($name) && '' !== $name) { return $name; } }