Closed github-mathieu-salles closed 7 years ago
A lead I have is that my editForm is a nested form :
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder
->add('name', 'text', array(
'label' => 'Name',
'max_length' => 255,
))
->add('target', 'targeting', array(
'cascade_validation' => true,
));
}
Aw, yes. All of this will break in Sf < 2.8, because it introduced major changes in the form component. I have been trying to do a quick fix, but it would need more work than that. As reference, this kind of work is what would be needed https://github.com/matthiasnoback/symfony-console-form/commit/8554cdfd454ae0b6dfd8452a67199d0974b323f5#diff-4686463430e4b4932c485ab974a92154 (Note that in this case they are deprecating sf2.7, but the lines in red contain hints of what is needed to support 2.7).
After thinking, and as suggested in this PR, I have decided to not support 2.7, because it would require to maintain a complete different code base. It would be like maintaining two separate libs.
Got this error when I tried to generate a schema with liform :
Here my two code lines :
$editForm = $this->createForm(new EditType(), $entity, array( 'method' => 'PUT', 'csrf_protection' => false, ));
$schema = json_encode($this->get('liform')->transform($editForm));
I saw a bug related to that and it seems to be fixed with 2.8 version but of course my project is using 2.7 : https://github.com/symfony/symfony/issues/15760