From 487ccf0d8caeeb5685b1c89afd6996fbfa0b365f Mon Sep 17 00:00:00 2001 From: Peter Potrowl Date: Wed, 8 Feb 2017 14:27:29 +0100 Subject: [PATCH] Fix bug in property accessor in ModelType. --- Form/Type/ModelType.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Form/Type/ModelType.php b/Form/Type/ModelType.php index c1c69548..410975bd 100644 --- a/Form/Type/ModelType.php +++ b/Form/Type/ModelType.php @@ -215,7 +215,7 @@ public function configureOptions(OptionsResolver $resolver) /** @var ModelCriteria $query */ $query = $options['query']; - $choiceLabel = function($choice) use ($valueProperty) { + $choiceLabel = function($choice) use ($valueProperty, $query) { $getter = 'get'.ucfirst($valueProperty); if (!method_exists($choice, $getter)) { $getter = 'get' . ucfirst($query->getTableMap()->getColumn($valueProperty)->getPhpName());