Skip to content
This repository was archived by the owner on Aug 1, 2024. It is now read-only.
This repository was archived by the owner on Aug 1, 2024. It is now read-only.

Using ChoiceFilterType generate: Undefined constant Doctrine\DBAL\Types\Type::STRING #353

@AizeLeOuf

Description

@AizeLeOuf

Hi everyone,

First of all, many thanks for all the work done in this bundle.

here my issue:

In my entity:

    /**
     * @ORM\Column(type="boolean")
     */
    private $state;

In my form:

$builder->add('state', Filters\ChoiceFilterType::class, [
            'choices'  => [
                'Validated' => true,
                'To validate' => false,
            ],
        ]);

In my controller:

if ($form->isSubmitted() && $form->isValid()) {
            $queryBuilder->addFilterConditions($form, $filterBuilder);
        }

This code generate:

Undefined constant Doctrine\DBAL\Types\Type::STRING

when I submit the form with a valid value (select 'Validated' or 'To Validated'). With null it's ok... Any help on it will be great !

Regards,

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