8000 merge attr options only · symfony/symfony@d239328 · GitHub
[go: up one dir, main page]

Skip to content

Commit d239328

Browse files
committed
merge attr options only
1 parent cf95089 commit d239328

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/Symfony/Component/Form/FormFactory.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,13 @@ public function createBuilderForProperty($class, $property, $data = null, array
126126

127127
// user options may override guessed options
128128
if ($typeGuess) {
129-
$options = array_replace_recursive($typeGuess->getOptions(), $options);
129+
$attrOptions = array();
130+
$typeGuessOptions = $typeGuess->getOptions();
131+
if (isset($typeGuessOptions['attr']) && isset($options['attr'])) {
132+
$attrOptions = array('attr' => array_merge($typeGuessOptions['attr'], $options['attr']));
133+
}
134+
135+
$options = array_merge($typeGuessOptions, $options, $attrOptions);
130136
}
131137

132138
return $this->createNamedBuilder($property, $type, $data, $options);

0 commit comments

Comments
 (0)
0