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 d6163a8

Browse filesBrowse files
Daan van Renterghemfabpot
authored andcommitted
Fix for cache-key conflict when having a \Traversable as choices
1 parent 28e9e06 commit d6163a8
Copy full SHA for d6163a8

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.