Skip to content

Commit

Permalink
Fix for cache-key conflict when having a \Traversable as choices
Browse files Browse the repository at this point in the history
  • Loading branch information
Daan van Renterghem authored and fabpot committed Dec 29, 2013
1 parent 28e9e06 commit d6163a8
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/Symfony/Bridge/Doctrine/Form/Type/DoctrineType.php
Expand Up @@ -89,6 +89,13 @@ public function setDefaultOptions(OptionsResolverInterface $resolver)
array_walk_recursive($choiceHashes, function (&$value) {
$value = spl_object_hash($value);
});
} elseif ($choiceHashes instanceof \Traversable) {
$hashes = array();
foreach ($choiceHashes as $value) {
$hashes[] = spl_object_hash($value);
}

$choiceHashes = $hashes;
}

$preferredChoiceHashes = $options['preferred_choices'];
Expand Down

0 comments on commit d6163a8

Please sign in to comment.