Skip to content

Commit 59362a9

Browse files
committed
bug symfony#17668 add 'guid' to list of exception to filter out (garak)
This PR was squashed before being merged into the 2.3 branch (closes symfony#17668). Discussion ---------- add 'guid' to list of exception to filter out | Q | A | ------------- | --- | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | symfony#14583 | License | MIT | Doc PR | none See symfony#14583 (comment) Commits ------- 0de86ff add 'guid' to list of exception to filter out
2 parents 2e9e83e + 0de86ff commit 59362a9

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/Symfony/Bridge/Doctrine/Form/ChoiceList/ORMQueryBuilderLoader.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,13 @@ public function getEntitiesByIds($identifier, array $values)
9393
$values = array_values(array_filter($values, function ($v) {
9494
return (string) $v === (string) (int) $v;
9595
}));
96+
} elseif ('guid' === $metadata->getTypeOfField($identifier)) {
97+
$parameterType = Connection::PARAM_STR_ARRAY;
98+
99+
// Like above, but we just filter out empty strings.
100+
$values = array_values(array_filter($values, function ($v) {
101+
return (string) $v !== '';
102+
}));
96103
} else {
97104
$parameterType = Connection::PARAM_STR_ARRAY;
98105
}

0 commit comments

Comments
 (0)