Skip to content
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

[Doctrine][Form] support large integers #20499

Merged
merged 1 commit into from Nov 22, 2016

Conversation

Projects
None yet
4 participants
@xabbuh
Copy link
Member

commented Nov 12, 2016

Q A
Branch? 2.7
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets #15642
License MIT
Doc PR n/a
@fabpot

This comment has been minimized.

Copy link
Member

commented Nov 22, 2016

Thank you @xabbuh.

@fabpot fabpot merged commit 6954a07 into symfony:2.7 Nov 22, 2016

3 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
fabbot.io Your code looks good.
Details

fabpot added a commit that referenced this pull request Nov 22, 2016

bug #20499 [Doctrine][Form] support large integers (xabbuh)
This PR was merged into the 2.7 branch.

Discussion
----------

[Doctrine][Form] support large integers

| Q             | A
| ------------- | ---
| Branch?       | 2.7
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #15642
| License       | MIT
| Doc PR        | n/a

Commits
-------

6954a07 [Doctrine][Form] support large integers

@xabbuh xabbuh deleted the xabbuh:issue-15642 branch Nov 22, 2016

@@ -104,7 +104,7 @@ public function getEntitiesByIds($identifier, array $values)
// Filter out non-integer values (e.g. ""). If we don't, some
// databases such as PostgreSQL fail.
$values = array_values(array_filter($values, function ($v) {
return (string) $v === (string) (int) $v;
return (string) $v === (string) (int) $v || ctype_digit($v);

This comment has been minimized.

Copy link
@apfelbox

apfelbox Nov 22, 2016

Contributor

Why aren't you only using ctype_digit()? Does the first test anything, that the second test does not?

This comment has been minimized.

Copy link
@xabbuh

xabbuh Nov 22, 2016

Author Member

Yes, ctype_digit() does not work with integers: https://3v4l.org/oi7fd

This comment has been minimized.

Copy link
@apfelbox

apfelbox Nov 22, 2016

Contributor

Yes, you are right. Maybe is_int($v) || ctype_digit($v) or ctype_digit((string) $v) would be more readable.
Not important, though.

@fabpot fabpot referenced this pull request Nov 27, 2016

Merged

Release v3.2.0-RC2 #20649

This was referenced Dec 13, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.