From 6f7ea8dbbe6cef481a30b54015df6c8f7f1b2949 Mon Sep 17 00:00:00 2001 From: Tobias Schultze Date: Tue, 24 Jul 2012 01:15:14 +0200 Subject: [PATCH] [Form] fix ObjectChoiceList when property path is '0' --- .../Form/Extension/Core/ChoiceList/ObjectChoiceList.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Symfony/Component/Form/Extension/Core/ChoiceList/ObjectChoiceList.php b/src/Symfony/Component/Form/Extension/Core/ChoiceList/ObjectChoiceList.php index c100b45002..6c3c79bf8a 100644 --- a/src/Symfony/Component/Form/Extension/Core/ChoiceList/ObjectChoiceList.php +++ b/src/Symfony/Component/Form/Extension/Core/ChoiceList/ObjectChoiceList.php @@ -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); }