diff --git a/src/Form/CollectionTypeExtension.php b/src/Form/CollectionTypeExtension.php index 1ca9fb8f..fb47a012 100644 --- a/src/Form/CollectionTypeExtension.php +++ b/src/Form/CollectionTypeExtension.php @@ -53,7 +53,7 @@ class CollectionTypeExtension extends AbstractTypeExtension public static function getExtendedTypes(): iterable { - return [CollectionType::class]; + return [CollectionType::class, WorkaroundCollectionType::class]; } public function configureOptions(OptionsResolver $resolver): void diff --git a/src/Form/Part/OrderdetailType.php b/src/Form/Part/OrderdetailType.php index c6400145..8605b411 100644 --- a/src/Form/Part/OrderdetailType.php +++ b/src/Form/Part/OrderdetailType.php @@ -47,6 +47,7 @@ use App\Entity\Parts\Supplier; use App\Entity\PriceInformations\Orderdetail; use App\Entity\PriceInformations\Pricedetail; use App\Form\Type\StructuralEntityType; +use App\Form\WorkaroundCollectionType; use Symfony\Component\Form\AbstractType; use Symfony\Component\Form\Extension\Core\Type\CheckboxType; use Symfony\Component\Form\Extension\Core\Type\CollectionType; @@ -109,7 +110,7 @@ class OrderdetailType extends AbstractType } //Attachment section - $event->getForm()->add('pricedetails', CollectionType::class, [ + $event->getForm()->add('pricedetails', WorkaroundCollectionType::class, [ 'entry_type' => PricedetailType::class, 'allow_add' => $this->security->isGranted('@parts_prices.create'), 'allow_delete' => $this->security->isGranted('@parts_prices.delete'), diff --git a/src/Form/Part/PartBaseType.php b/src/Form/Part/PartBaseType.php index 9a85882e..cab0c8ce 100644 --- a/src/Form/Part/PartBaseType.php +++ b/src/Form/Part/PartBaseType.php @@ -56,6 +56,7 @@ use App\Form\ParameterType; use App\Form\Type\MasterPictureAttachmentType; use App\Form\Type\SIUnitType; use App\Form\Type\StructuralEntityType; +use App\Form\WorkaroundCollectionType; use FOS\CKEditorBundle\Form\Type\CKEditorType; use Symfony\Component\Form\AbstractType; use Symfony\Component\Form\Extension\Core\Type\CheckboxType; @@ -258,7 +259,7 @@ class PartBaseType extends AbstractType ]); //Orderdetails section - $builder->add('orderdetails', CollectionType::class, [ + $builder->add('orderdetails', WorkaroundCollectionType::class, [ 'entry_type' => OrderdetailType::class, 'allow_add' => $this->security->isGranted('orderdetails.create', $part), 'allow_delete' => $this->security->isGranted('orderdetails.delete', $part), diff --git a/src/Form/WorkaroundCollectionType.php b/src/Form/WorkaroundCollectionType.php new file mode 100644 index 00000000..20a0cc27 --- /dev/null +++ b/src/Form/WorkaroundCollectionType.php @@ -0,0 +1,31 @@ +vars['prototype']->vars['multipart']) { + $view->vars['multipart'] = true; + } + } +} \ No newline at end of file