Skip to content

Commit

Permalink
Directly add the hidden field to the form builder
Browse files Browse the repository at this point in the history
This prevents creating an empty 'default' tab
  • Loading branch information
jorrit committed Aug 31, 2021
1 parent f76555e commit 34fa8c6
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions src/Admin/Extension/CloneAdminExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -115,14 +115,10 @@ public function configureFormFields(FormMapper $formMapper)
}

if ($subjectId !== null) {
$formMapper->add(
self::REQUEST_ATTRIBUTE,
HiddenType::class,
[
'data' => $subjectId,
'mapped' => false,
]
);
$formMapper->getFormBuilder()->add(self::REQUEST_ATTRIBUTE, HiddenType::class, [
'data' => $subjectId,
'mapped' => false,
]);
}
}

Expand Down

0 comments on commit 34fa8c6

Please sign in to comment.