From 435a0993e408036ccff4aa17726c37a7d1b48ee0 Mon Sep 17 00:00:00 2001 From: Piotr Rogowski Date: Thu, 15 Oct 2020 15:54:34 +0200 Subject: [PATCH] Do not allow null values for number of last releases when updating (#302) --- src/Form/Type/Api/EditPackageType.php | 1 + src/Form/Type/Organization/EditPackageType.php | 1 + 2 files changed, 2 insertions(+) diff --git a/src/Form/Type/Api/EditPackageType.php b/src/Form/Type/Api/EditPackageType.php index 24e8f996..9cb29446 100644 --- a/src/Form/Type/Api/EditPackageType.php +++ b/src/Form/Type/Api/EditPackageType.php @@ -36,6 +36,7 @@ public function buildForm(FormBuilderInterface $builder, array $options): void 'label' => 'Keep last releases', 'help' => 'Number of last releases that will be downloaded. Put "0" to download all.', 'constraints' => [ + new NotBlank(), new PositiveOrZero(), ], ]); diff --git a/src/Form/Type/Organization/EditPackageType.php b/src/Form/Type/Organization/EditPackageType.php index dfcfe170..c917fc5e 100644 --- a/src/Form/Type/Organization/EditPackageType.php +++ b/src/Form/Type/Organization/EditPackageType.php @@ -35,6 +35,7 @@ public function buildForm(FormBuilderInterface $builder, array $options): void 'label' => 'Keep last releases', 'help' => 'Number of last releases that will be downloaded. Put "0" to download all.', 'constraints' => [ + new NotBlank(), new PositiveOrZero(), ], ])