-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[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
Conversation
|
||
// Filter out non-integer values (e.g. ""). If we don't, some | ||
// databases such as PostgreSQL fail. | ||
// https://github.com/symfony/symfony/issues/14583 |
There was a problem hiding this comment.
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.
Does it replace #14617? |
Yes, I closed that issue. The PR is updated now. |
Thank you @webmozart. |
…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
It's a pity that this fix isn't part of the 2.7.1 release. So there's still a BC break. 😞 |
Shouldn't this one go in 2.3 also? |
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 |
@nicolas-grekas Good point, can you work on a backport? Handling empty arrays properly across DBMS should be a Doctrine issue no? |
See #15027 |
@webmozart this has been solved in DBAL. But not backported to EOMed versions |
…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
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? |
@murilolobato The fix is merged, but not released yet. 😞 |
Can we have a release for this? At least an expected release date? This is quite annoying... |
@zefrog already in the new version 2.7.2 |
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. |
@murilolobato, please read this doc entry about the release process. |
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. |
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).