maker-bundle
maker-bundle copied to clipboard
make:form and make:crud don't inject typeFields of entity in form's template
Good morning !
I want to automate more my developments in Symfony 4. For that, I wanted to fork the maker-bundle and inject in the template Type.tpl.php the typeFields. However, this is already coded but the result is always : ->add('myAttibute') and not ->add('myAttibute', fieldType::class, ...) However, there are this lines in the code (src/Resources/skeleton/crud/form/Type.tpl.php):
` public function buildForm(FormBuilderInterface $builder, array $options) { $builder
$typeOptions): ?> ->add('<?= $form_field ?>')
->add('<?= $form_field ?>', <?= $typeOptions['type'] ?>::class)
->add('<?= $form_field ?>', <?= $typeOptions['type'] ? ($typeOptions['type'].'::class') : 'null' ?>, [
= $typeOptions['options_code']."\n" ?>
])
;
}`
Thank you for yours answers. Have a nice day !
Nice issue description @ruifpedro! Thank you.
I'll tag some folks with more knowledge about that feature: @betodealmeida @eschutho @rusackas
Hello @ruifpedro thank you for detailed explanation. It helped us as well.
Hello @ruifpedro , Your detailed explanation helped us figure out that checking the "enable row expansion" is causing the dashboard import error in the same instance and different instance, we fixed it by writing code to stop schema options keys from going into the export zip. we noticed that we are unable to uncheck the "enable row expansion" using GUI and we used curl to uncheck it. Many Thanks once again and hope this helps others as well. Good day
@ruifpedro do you manage to solve the issue?i get the same issue how can i fix it?
Hello @ruifpedro , Your detailed explanation helped us figure out that checking the "enable row expansion" is causing the dashboard import error in the same instance and different instance, we fixed it by writing code to stop schema options keys from going into the export zip. we noticed that we are unable to uncheck the "enable row expansion" using GUI and we used curl to uncheck it. Many Thanks once again and hope this helps others as well. Good day
I've missed your comment! Yes that it's the case, I'm also unable to uncheck the "enable row expansion" option.
@ruifpedro do you manage to solve the issue?i get the same issue how can i fix it?
As my first post states, I've managed to circumvent the problem by simply, exporting the dashboard, opening up the zip and modifying the respective database yaml to manually remove the extra.schema_options
key and values. Zip the contents and then you have a valid set of assets that can be imported.