merged branch sterrien/patch-4 (PR #7519)
This PR was merged into the 2.1 branch.
Discussion
----------
[Form] [Doctrine] [EntityChoiceList] idAsIndex should be true with a smallint id field.
When the id of an entity is a smallint, $this->idAsIndex should also be true.
It was not the case.
Bug fix: yes
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: should
License of the code: MIT
Commits
-------
673fd9b
idAsIndex should be true with a smallint or bigint id field.
This commit is contained in:
commit
bf7daa11e7
|
@ -111,7 +111,7 @@ class EntityChoiceList extends ObjectChoiceList
|
|||
$this->idField = $identifier[0];
|
||||
$this->idAsValue = true;
|
||||
|
||||
if ('integer' === $this->classMetadata->getTypeOfField($this->idField)) {
|
||||
if (in_array($this->classMetadata->getTypeOfField($this->idField), array('integer', 'smallint', 'bigint'))) {
|
||||
$this->idAsIndex = true;
|
||||
}
|
||||
}
|
||||
|
|
Reference in New Issue