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

Appearance settings

Commit be01e34

Browse filesBrowse files
committed
bug #9557 [DoctrineBridge] Fix for cache-key conflict when having a \Traversable as choices (DRvanR)
This PR was submitted for the 2.3-dev branch but it was merged into the 2.3 branch instead (closes #9557). Discussion ---------- [DoctrineBridge] Fix for cache-key conflict when having a \Traversable as choices | Q | A | ------------- | --- | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #9556 | License | MIT | Doc PR | ~ Commits ------- 1119684 Fix for cache-key conflict when having a \Traversable as choices
2 parents 28e9e06 + d6163a8 commit be01e34
Copy full SHA for be01e34

File tree

Expand file treeCollapse file tree

1 file changed

+7
-0
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+7
-0
lines changed

‎src/Symfony/Bridge/Doctrine/Form/Type/DoctrineType.php

Copy file name to clipboardExpand all lines: src/Symfony/Bridge/Doctrine/Form/Type/DoctrineType.php
+7Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,13 @@ public function setDefaultOptions(OptionsResolverInterface $resolver)
8989
array_walk_recursive($choiceHashes, function (&$value) {
9090
$value = spl_object_hash($value);
9191
});
92+
} elseif ($choiceHashes instanceof \Traversable) {
93+
$hashes = array();
94+
foreach ($choiceHashes as $value) {
95+
$hashes[] = spl_object_hash($value);
96+
}
97+
98+
$choiceHashes = $hashes;
9299
}
93100

94101
$preferredChoiceHashes = $options['preferred_choices'];

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.