Added a workaround for an symfony issue with collectiontype.

This commit is contained in:
Jan Böhmer 2020-05-31 19:42:44 +02:00
parent 3021d0d67a
commit 54fa445f06
4 changed files with 36 additions and 3 deletions

View file

@ -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'),

View file

@ -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),