Skip to content

Commit 5fa1f12

Browse files
[Form] fix truncating form views in data collector
1 parent d61beda commit 5fa1f12

File tree

2 files changed

+2
-5
lines changed

2 files changed

+2
-5
lines changed

src/Symfony/Component/Form/Extension/DataCollector/FormDataCollector.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
use Symfony\Component\Validator\ConstraintViolationInterface;
2020
use Symfony\Component\VarDumper\Caster\Caster;
2121
use Symfony\Component\VarDumper\Caster\ClassStub;
22+
use Symfony\Component\VarDumper\Caster\StubCaster;
2223
use Symfony\Component\VarDumper\Cloner\Stub;
2324

2425
/**
@@ -262,6 +263,7 @@ protected function getCasters()
262263
Caster::PREFIX_VIRTUAL.'type_class' => new ClassStub(get_class($f->getConfig()->getType()->getInnerType())),
263264
);
264265
},
266+
FormView::class => array(StubCaster::class, 'cutInternals'),
265267
ConstraintViolationInterface::class => function (ConstraintViolationInterface $v, array $a) {
266268
return array(
267269
Caster::PREFIX_VIRTUAL.'root' => $v->getRoot(),

src/Symfony/Component/Form/Extension/DataCollector/FormDataExtractor.php

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
use Symfony\Component\Form\FormView;
1616
use Symfony\Component\HttpKernel\DataCollector\Util\ValueExporter;
1717
use Symfony\Component\Validator\ConstraintViolationInterface;
18-
use Symfony\Component\VarDumper\Caster\CutStub;
1918

2019
/**
2120
* Default implementation of {@link FormDataExtractorInterface}.
@@ -156,10 +155,6 @@ public function extractViewVariables(FormView $view)
156155
);
157156

158157
foreach ($view->vars as $varName => $value) {
159-
// Removing redundant variable from view variables
160-
if ('form' === $varName) {
161-
$value = new CutStub($value);
162-
}
163158
$data['view_vars'][$varName] = $value;
164159
}
165160

0 commit comments

Comments
 (0)