sonata-project/SonataAdminBundle — Issue #524: Invalid State exception in  the list when using a basic string column
Author: COil
Created: 2012-01-29 18:15:59+00:00
State: open

Company is a basic string column:

```
/**
* @var string $company
*
* @ORM\Column(name="company", type="string", length=255, nullable=false)
* @Assert\NotBlank
*/
private $company;

```

```php
protected function configureListFields(ListMapper $listMapper)
{
$listMapper
->addIdentifier('id')
->add('category')
->add('type')
->add('company')
->add('isPublic')
->add('isActivated')
->add('position')
->add('company')
->add('_action', 'actions', array(
'actions' => array(
'view' => array(),
'edit' => array(),
'delete' => array(),
)
))
;
}
```

Lead to this error:

```
in /Users/coil/Sites/jobeet2/vendor/bundles/Sonata/AdminBundle/Datagrid/ListMapper.php at line 78
var_dump($name); echo '
';
var_dump(is_string($name)); echo '
';
var_dump($this->admin->hasListFieldDescription($name)); echo '
';

throw new \RuntimeException('invalid state');

}
if (!$fieldDescription->getLabel()) {
```

string 'company' (length=7)
boolean true
boolean true

When I comment the field in configureListFields() it works well.