[Form] fix ObjectChoiceList when property path is '0'

This commit is contained in:
Tobias Schultze 2012-07-24 01:15:14 +02:00
parent 8da33eb5bc
commit 6f7ea8dbbe

View File

@ -78,9 +78,9 @@ class ObjectChoiceList extends ChoiceList
*/
public function __construct($choices, $labelPath = null, array $preferredChoices = array(), $groupPath = null, $valuePath = null)
{
$this->labelPath = $labelPath ? new PropertyPath($labelPath) : null;
$this->groupPath = $groupPath ? new PropertyPath($groupPath) : null;
$this->valuePath = $valuePath ? new PropertyPath($valuePath) : null;
$this->labelPath = null !== $labelPath ? new PropertyPath($labelPath) : null;
$this->groupPath = null !== $groupPath ? new PropertyPath($groupPath) : null;
$this->valuePath = null !== $valuePath ? new PropertyPath($valuePath) : null;
parent::__construct($choices, array(), $preferredChoices);
}