8000 Merge branch '3.1' · symfony/symfony@3c47306 · GitHub
[go: up one dir, main page]

Skip to content

Commit 3c47306

Browse files
committed
Merge branch '3.1'
* 3.1: [CS] Respect PSR2 4.2 [Form] fix `empty_data` option in expanded `ChoiceType` [Console] removed unneeded private methods updated Http-Kernel dependency [Security] [Guard] Improve comment with working example sync min email validator version [TwigBridge] Fix inconsistency in LintCommand help explicitly forbid e-mail validator 2.0 or higher Fixed SymfonyQuestionHelper multi-choice with defaults [DoctrineBridge] Don't use object IDs in DoctrineChoiceLoader when passing a value closure Differentiate between the first time a progress bar is displayed and subsequent times finished previous commit No more exception for malformed input name fix post_max_size_message translation [Process] Fix pipes cleaning on Windows Avoid phpunit 5.4 warnings on getMock [Form] Add exception to FormRenderer about non-unique block names [FrameworkBundle] templating can be fully disabled [Form] Consider a violation even if the form is not submitted
2 parents f67912f + 45ce2c8 commit 3c47306

File tree

36 files changed

+937
-142
lines changed

36 files changed

+937
-142
lines changed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,9 +114,10 @@ public function loadValuesForChoices(array $choices, $value = null)
114114

115115
// Optimize performance for single-field identifiers. We already
116116
// know that the IDs are used as values
117+
$optimize = null === $value || is_array($value) && $value[0] === $this->idReader;
117118

118119
// Attention: This optimization does not check choices for existence
119-
if (!$this->choiceList && $this->idReader->isSingleId()) {
120+
if ($optimize && !$this->choiceList && $this->idReader->isSingleId()) {
120121
$values = array();
121122

122123
// Maintain order and indices of the given objects

0 commit comments

Comments
 (0)
0