From 5e98478d94a4f4c48bef5fb5b7cdb37d6f54ec12 Mon Sep 17 00:00:00 2001 From: Javier Spagnoletti Date: Sun, 22 Apr 2018 20:12:04 -0300 Subject: [PATCH] [DoctrineBridge] Improve exception message at `IdReader::getIdValue()` --- src/Symfony/Bridge/Doctrine/Form/ChoiceList/IdReader.php | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/Symfony/Bridge/Doctrine/Form/ChoiceList/IdReader.php b/src/Symfony/Bridge/Doctrine/Form/ChoiceList/IdReader.php index ee8ec2ddab..1d88184926 100644 --- a/src/Symfony/Bridge/Doctrine/Form/ChoiceList/IdReader.php +++ b/src/Symfony/Bridge/Doctrine/Form/ChoiceList/IdReader.php @@ -95,10 +95,7 @@ class IdReader } if (!$this->om->contains($object)) { - throw new RuntimeException( - 'Entities passed to the choice field must be managed. Maybe '. - 'persist them in the entity manager?' - ); + throw new RuntimeException(sprintf('Entity of type "%s" passed to the choice field must be managed. Maybe you forget to persist it in the entity manager?', get_class($object))); } $this->om->initializeObject($object);