Skip to content

Commit 01b7b6f

Browse files
committed
IBX-6937: Used NumberType field to set max image size in ImageFormMapper
https://issues.ibexa.co/browse/IBX-6937
1 parent 9d8cd93 commit 01b7b6f

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/lib/FieldType/Mapper/ImageFormMapper.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
use Ibexa\Contracts\Core\Repository\FieldTypeService;
1313
use JMS\TranslationBundle\Annotation\Desc;
1414
use Symfony\Component\Form\Extension\Core\Type\CheckboxType;
15-
use Symfony\Component\Form\Extension\Core\Type\IntegerType;
15+
use Symfony\Component\Form\Extension\Core\Type\NumberType;
1616
use Symfony\Component\Form\FormInterface;
1717
use Symfony\Component\OptionsResolver\OptionsResolver;
1818
use Symfony\Component\Validator\Constraints\Range;
@@ -31,7 +31,7 @@ public function mapFieldDefinitionForm(FormInterface $fieldDefinitionForm, Field
3131
{
3232
$isTranslation = $data->contentTypeData->languageCode !== $data->contentTypeData->mainLanguageCode;
3333
$fieldDefinitionForm
34-
->add('maxSize', IntegerType::class, [
34+
->add('maxSize', NumberType::class, [
3535
'required' => false,
3636
'property_path' => 'validatorConfiguration[FileSizeValidator][maxFileSize]',
3737
'label' => /** @Desc("Maximum file size (MB)") */ 'field_definition.ezimage.max_file_size',
@@ -46,6 +46,7 @@ public function mapFieldDefinitionForm(FormInterface $fieldDefinitionForm, Field
4646
'max' => $this->maxUploadSize->get(MaxUploadSize::MEGABYTES),
4747
],
4848
'disabled' => $isTranslation,
49+
'scale' => 1,
4950
])
5051
->add('isAlternativeTextRequired', CheckboxType::class, [
5152
'required' => false,

0 commit comments

Comments
 (0)