Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit ccd9c1f

Browse filesBrowse files
committed
bug #37276 [Form] Fixed block prefixes hierarchy of the CollectionType (yceruto)
This PR was merged into the 5.1 branch. Discussion ---------- [Form] Fixed block prefixes hierarchy of the CollectionType | Q | A | ------------- | --- | Branch? | 5.1 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | Fix #37024 | License | MIT | Doc PR | - /cc @HeahDude Commits ------- a8f2c60 fixed block prefixes hierarchy of the CollectionType
2 parents a89cc6b + a8f2c60 commit ccd9c1f
Copy full SHA for ccd9c1f

File tree

2 files changed

+4
-4
lines changed
Filter options

2 files changed

+4
-4
lines changed

‎src/Symfony/Component/Form/Extension/Core/Type/CollectionType.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Form/Extension/Core/Type/CollectionType.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ public function buildView(FormView $view, FormInterface $form, array $options)
7272
*/
7373
public function finishView(FormView $view, FormInterface $form, array $options)
7474
{
75-
$prefixOffset = -1;
75+
$prefixOffset = -2;
7676
// check if the entry type also defines a block prefix
7777
/** @var FormInterface $entry */
7878
foreach ($form as $entry) {

‎src/Symfony/Component/Form/Tests/Extension/Core/Type/CollectionTypeTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Form/Tests/Extension/Core/Type/CollectionTypeTest.php
+3-3Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -415,8 +415,8 @@ public function testEntriesBlockPrefixes()
415415

416416
$expectedBlockPrefixes = [
417417
'form',
418-
'text',
419418
'collection_entry',
419+
'text',
420420
'_fields_entry',
421421
];
422422

@@ -436,8 +436,8 @@ public function testEntriesBlockPrefixesWithCustomBlockPrefix()
436436
$this->assertCount(1, $collectionView);
437437
$this->assertSame([
438438
'form',
439-
'text',
440439
'collection_entry',
440+
'text',
441441
'field',
442442
'_fields_entry',
443443
], $collectionView[0]->vars['block_prefixes']);
@@ -454,8 +454,8 @@ public function testEntriesBlockPrefixesWithCustomBlockPrefixedType()
454454
$this->assertCount(1, $collectionView);
455455
$this->assertSame([
456456
'form',
457-
'block_prefixed_foo_text',
458457
'collection_entry',
458+
'block_prefixed_foo_text',
459459
'foo',
460460
'_fields_entry',
461461
], $collectionView[0]->vars['block_prefixes']);

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.