Skip to content

Commit

Permalink
Fix using layout copy form when name and identifier are empty
Browse files Browse the repository at this point in the history
  • Loading branch information
emodric committed Nov 10, 2023
1 parent 9503f50 commit ce2f14c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions lib/Layout/Form/CopyType.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ public function buildForm(FormBuilderInterface $builder, array $options): void
TextType::class,
[
'label' => 'layout.name',
'empty_data' => '',
'constraints' => [
new Constraints\NotBlank(),
new LayoutName(),
Expand Down
2 changes: 1 addition & 1 deletion lib/Validator/LayoutNameValidator.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public function validate($value, Constraint $constraint): void
throw new UnexpectedTypeException($constraint, LayoutName::class);
}

if ($value === null) {
if ($value === null || $value === '') {
return;
}

Expand Down

0 comments on commit ce2f14c

Please sign in to comment.