Skip to content

Does not support full range of native FormTypes - Symfony 4.3.4  #23

Description

@AndrewMacKay-base

I'm uncertain whether the issue I'm experiencing is because my current version of Symfony 4.3.4 is unsupported by this bundle, or due to some specific implementation issue in our installation, or whether actually the bundle does not support all the different types included by Symfony.

use Limenius\Liform\Resolver;
use Limenius\Liform\Liform;
use Limenius\Liform\Liform\Transformer;
...
public function edit(Activity $activity, Liform $liform, Request $request)
    {
    // $builder->add('startDate', DateType::class, [
    $form = $this->createForm(ActivityFormType::class, $activity, []);
    $schema = $liform->transform($form);
...
}

The above pattern works as expected for TextType, and ChoiceType, but falls over for DateType with the error

"Could not find a transformer for any of these types (date, form) "

The documenation does not make it clear whether I should expect this functionality to exist. It suggests I will need to add custom work to include custom extension, however seems to imply that it should work out the box with a standard Symfony install.

I notice that DateType and EntityType do not seem to be in the list of available transformers here.

https://github.com/Limenius/LiformBundle/blob/master/Resources/config/transformers.xml

Am I correct then in my understanding that DateType which is a standard Symfony type is not supported?
https://symfony.com/doc/current/reference/forms/types/date.html

Edit
Also from here http://nacho-martin.com/serializing-symfony-forms-to-json-schema.html
This overview seems to imply dates are supported
->add('dueTo', Type\DateTimeType::class, [
Using the DateTimeType we get a similar error Could not find a transformer for any of these types (datetime)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions