Skip to content

Commit

Permalink
Fix bug in property accessor in ModelType.
Browse files Browse the repository at this point in the history
  • Loading branch information
peter17 authored and SkyFoxvn committed Jul 11, 2021
1 parent 7ff995f commit 487ccf0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Form/Type/ModelType.php
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down

0 comments on commit 487ccf0

Please sign in to comment.