Skip to content

Commit c9aefdd

Browse files
committed
Start with an empty selection of category when a new part is created, so that the user has to manually select it
1 parent 3ad0886 commit c9aefdd

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/Form/Part/PartBaseType.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,8 @@ public function buildForm(FormBuilderInterface $builder, array $options): void
101101
'dto_value' => $dto?->category,
102102
'label' => 'part.edit.category',
103103
'disable_not_selectable' => true,
104+
//Do not require category for new parts, so that the user must select the category by hand and cannot forget it (the requirement is handled by the constraint in the entity)
105+
'required' => !$new_part,
104106
])
105107
->add('footprint', StructuralEntityType::class, [
106108
'class' => Footprint::class,

0 commit comments

Comments
 (0)