Movatterモバイル変換


[0]ホーム

URL:


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

Sign up
Appearance settings

Fix EntityType->empty_data=null#19732

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Closed
pierre-H wants to merge1 commit intosymfony:masterfrompierre-H:patch-1
Closed

Fix EntityType->empty_data=null#19732

pierre-H wants to merge1 commit intosymfony:masterfrompierre-H:patch-1

Conversation

@pierre-H
Copy link

QA
Branch?"master"
Bug fix?yes
New feature?no
BC breaks?no
Deprecations?no
LicenseMIT

Symfony 3.1, Doctine 2.5, PHP 7, SQL Server

With :

$builder            ->add('users', EntityType::class, array(                'label' => 'Users',                'class' => 'AppBundle\Entity\Users',                'choice_label' => 'name',                'query_builder' => function (EntityRepository $er) {                    return $er->createQueryBuilder('u')                        ->orderBy('u.name', 'ASC');                },                'empty_data'  => null,                'required' => false            ))

I got an error :
SQLSTATE [42000, 8114]: [Microsoft][ODBC Driver 13 for SQL Server][SQL Server]Eror converting nvarchar datatype to numeric.

Symfony 3.1, Doctine 2.5, PHP 7, SQL ServerWith :```$builder            ->add('users', EntityType::class, array(                'label' => 'Users',                'class' => 'AppBundle\Entity\Users',                'choice_label' => 'name',                'query_builder' => function (EntityRepository $er) {                    return $er->createQueryBuilder('u')                        ->orderBy('u.name', 'ASC');                },                'empty_data'  => null,                'required' => false            ))```I got an error : SQLSTATE [42000, 8114]: [Microsoft][ODBC Driver 13 for SQL Server][SQL Server]Eror converting nvarchar datatype to numeric.
Copy link
Contributor

@lemoinemlemoinem left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Status: Reviewed

Copy link
Contributor

@lemoinemlemoinem left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Hi, Sorry, I've been too fast the first time.

Thank you for the contribution.

Could you add a test to make sure the bug doesn't reappears?

Plus, if you could include the whole PR template please, each part is important. If you think one is not relevant for your PR, please leave it empty or fill it with N/A instead of removing the line entirely.

Thank you!

@HeahDude
Copy link
Contributor

This fix is wrong. Ifmultiple option isfalse theempty_data should be an empty string notnull sincenullat this step won't be transformed properly. The docs will be fixed withsymfony/symfony-docs#6265.

lemoinem reacted with thumbs up emoji

@fabpotfabpot closed thisNov 10, 2016
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

1 more reviewer

@lemoinemlemoinemlemoinem requested changes

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

5 participants

@pierre-H@HeahDude@lemoinem@fabpot@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp