diff --git a/src/Eccube/Form/Extension/DoctrineOrmExtension.php b/src/Eccube/Form/Extension/DoctrineOrmExtension.php index 3f3125f34a9..78923640f26 100644 --- a/src/Eccube/Form/Extension/DoctrineOrmExtension.php +++ b/src/Eccube/Form/Extension/DoctrineOrmExtension.php @@ -22,6 +22,7 @@ */ namespace Eccube\Form\Extension; +use Doctrine\Common\Persistence\Mapping\MappingException; use Eccube\Application; use Symfony\Component\Form\AbstractTypeExtension; use Symfony\Component\Form\Extension\Core\Type\FormType; @@ -50,7 +51,11 @@ function (FormEvent $event) { $app = Application::getInstance(); $em = $app['orm.em']; // メタデータの取得 - $meta = $em->getClassMetadata($class); + try { + $meta = $em->getClassMetadata($class); + } catch (MappingException $e) { + return; + } // フィールドからフォームへ定義 $names = $meta->getFieldNames(); foreach ($names as $name) {