8000 [Form] Fixed: Filter non-integers when selecting entities by int ID by webmozart · Pull Request #14950 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[Form] Fixed: Filter non-integers when selecting entities by int ID #14950

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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 12, 2015

Conversation

webmozart
Copy link
Contributor
Q A
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets #14583 (for Doctrine, not Propel)
License MIT
Doc PR -

This PR fixes #14583 for Doctrine. Non-integer values (like "") are not passed to the database anymore when selecting entities by integer PK, which causes an error on some DBMSs (like PostgreSQL).


// Filter out non-integer values (e.g. ""). If we don't, some
// databases such as PostgreSQL fail.
// https://github.com/symfony/symfony/issues/14583
Copy link
Member

Choose a reason for hiding this comment

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

This reference should be removed. It will be part of the merge commit anyway with the full discussion.

@fabpot
Copy link
Member
fabpot commented Jun 11, 2015

Does it replace #14617?

@webmozart webmozart mentioned this pull request Jun 12, 2015
1 task
@webmozart
Copy link
Contributor Author

Yes, I closed that issue. The PR is updated now.

@fabpot
Copy link
Member
fabpot commented Jun 12, 2015

Thank you @webmozart.

@fabpot fabpot merged commit 352be8e into symfony:2.7 Jun 12, 2015
fabpot added a commit that referenced this pull request Jun 12, 2015
…by int ID (webmozart)

This PR was merged into the 2.7 branch.

Discussion
----------

[Form] Fixed: Filter non-integers when selecting entities by int ID

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #14583 (for Doctrine, not Propel)
| License       | MIT
| Doc PR        | -

This PR fixes #14583 for Doctrine. Non-integer values (like `""`) are not passed to the database anymore when selecting entities by integer PK, which causes an error on some DBMSs (like PostgreSQL).

Commits
-------

352be8e [Form] Fixed: Filter non-integers when selecting entities by int ID
@althaus
Copy link
Contributor
althaus commented Jun 15, 2015

It's a pity that this fix isn't part of the 2.7.1 release. So there's still a BC break. 😞

@nicolas-grekas
Copy link
Member

Shouldn't this one go in 2.3 also?
BTW, this broke the tests on the 2.7 branch: for some reason, older versions of DBAL can't handle an empty list of identifiers. We should workaround.

@stof
Copy link
Member
stof commented Jun 18, 2015

an empty list of identifiers should skip the DB query entirely anyway, even if newer DBAL versions can handle them. We already know it won't return anything

@webmozart
Copy link
Contributor Author

@nicolas-grekas Good point, can you work on a backport? Handling empty arrays properly across DBMS should be a Doctrine issue no?

@nicolas-grekas
Copy link
Member

See #15027

@stof
Copy link
Member
stof commented Jun 18, 2015

@webmozart this has been solved in DBAL. But not backported to EOMed versions

webmozart added a commit that referenced this pull request Jun 18, 2015
…by int ID (webmozart, nicolas-grekas)

This PR was merged into the 2.3 branch.

Discussion
----------

[Form] Fixed: Filter non-integers when selecting entities by int ID

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #14950
| License       | MIT
| Doc PR        | -

This is #14950 cherry-picked on 2.3 with a fix embedded.

Commits
-------

086c58c [DoctrineBridge] Bypass the db when no valid identifier is provided in ORMQueryBuilderLoader
45579fd [Form] Fixed: Filter non-integers when selecting entities by int ID
@murilolobato
Copy link

My symfony requirement in composer.json is "~2.7", after a composer update I received symfony 2.7.1, and I'm still experiencing this issue, of sql error when submit the entity field blank. This problem is solved in which version of symfony?

@althaus
Copy link
Contributor
althaus commented Jul 2, 2015

@murilolobato The fix is merged, but not released yet. 😞

@zefrog
Copy link
zefrog commented Jul 13, 2015

Can we have a release for this? At least an expected release date? This is quite annoying...

@matudelatower
Copy link

@zefrog already in the new version 2.7.2

@murilolobato
Copy link

How the release process works? Fabien is who generates the new tag? There is any documentation for this? So we can follow more precisely the process.

@phansys
Copy link
Contributor
phansys commented Jul 14, 2015

@murilolobato, please read this doc entry about the release process.

@murilolobato
Copy link

My fault to not give the correct attention to Contributing to Symfony part of documentation. I read it completely now, and all my doubts are answered.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants
0