8000 minor #28037 [Form] fix truncating form views in data collector (nico… · symfony/symfony@707e52a · GitHub
[go: up one dir, main page]

Skip to content

Commit 707e52a

Browse files
minor #28037 [Form] fix truncating form views in data collector (nicolas-grekas)
This PR was merged into the 3.4 branch. Discussion ---------- [Form] fix truncating form views in data collector | Q | A | ------------- | --- | Branch? | 3.4 | Bug fix? | no (fixing a non released patch) | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | - | License | MIT | Doc PR | - Fixes #27923. Commits ------- 5fa1f12 [Form] fix truncating form views in data collector
2 parents ad31667 + 5fa1f12 commit 707e52a

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)
0