Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

[Form] empty_data in ChoiceType can be a string what must not be called #25896

Copy link
Copy link
Closed
@peter-gribanov

Description

@peter-gribanov
Issue body actions
Q A
Bug report? yes
Feature request? no
BC Break report? no
RFC? no
Symfony version 2.8.33

Example problem:

->add('order', ChoiceType::class, [
    'expanded' => true,
    'choices' => [
        'view' => 'news.search.order.view',
        'name' => 'news.search.order.name',
        'date' => 'news.search.order.date',
    ],
    'empty_data' => 'date',
])

In this case, i get an error at this line:

Warning: date() expects parameter 1 to be string, object given

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.