I've the following FormBuilder in a Form/*Type.php class:
<?php
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder
->add('tpmTargetId', null, array('label' => 'Target', 'required' => true))
->add('tpmSourcePropertyId', 'entity', array( 'label' => 'Global property', 'class' => 'TI\ML\SyncBundle\Entity\MlProperties'))
;
}
The problem is with the field tpmSourcePropertyId , when creating a new entry it displays the correct options in the dropdown field and when saving it inserts the correct ID but when trying to edit that entry the dropdown defaults to option #1 instead of the saved ID.
If I render the field a type text it shows the correct ID stored.
I've seem this question but I seem to be already using the proposed solution.
What could I do to debug this? Thank you!
Aucun commentaire:
Enregistrer un commentaire