mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-12-22 19:09:31 +00:00
Added a workaround for an symfony issue with collectiontype.
This commit is contained in:
parent
3021d0d67a
commit
54fa445f06
4 changed files with 36 additions and 3 deletions
|
|
@ -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'),
|
||||
|
|
|
|||
|
|
@ -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),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue