Skip to content

Commit c0fffba

Browse files
authored
FIX: #152 add required false option to collections field in PageType (#153)
| Q | A | --------------- | ----- | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Related tickets | fixes #152 | License | MIT When creating a page the collections field is marked as required currently. However, as there is no validation behind that, you can still creating a page without select a collection. But as choosing a collection is optional (same as when creating a block, or media) the `collections` field in the `PageType` class should be set to `required = false`.
2 parents da2e867 + 8b8e7c4 commit c0fffba

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

src/Form/Type/PageType.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ public function buildForm(FormBuilderInterface $builder, array $options): void
6161
'label' => 'sylius_cms.ui.collections',
6262
'multiple' => true,
6363
'by_reference' => false,
64+
'required' => false,
6465
])
6566
->add('channels', ChannelChoiceType::class, [
6667
'label' => 'sylius_cms.ui.channels',

0 commit comments

Comments
 (0)