浏览代码

[DoctrineBridge] fixed guesser

Fabien Potencier 14 年之前
父节点
当前提交
293ba3426a
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      src/Symfony/Bridge/Doctrine/Form/DoctrineOrmTypeGuesser.php

+ 1 - 1
src/Symfony/Bridge/Doctrine/Form/DoctrineOrmTypeGuesser.php

@@ -98,7 +98,7 @@ class DoctrineOrmTypeGuesser implements FormTypeGuesserInterface
     public function guessMaxLength($class, $property)
     {
         $ret = $this->getMetadata($class);
-        if ($ret && !$ret[0]->hasAssociation($property)) {
+        if ($ret && $ret[0]->hasField($property) && !$ret[0]->hasAssociation($property)) {
             $mapping = $ret[0]->getFieldMapping($property);
 
             if (isset($mapping['length'])) {