diff --git a/EMS/core-bundle/src/Form/DataField/AssetFieldType.php b/EMS/core-bundle/src/Form/DataField/AssetFieldType.php index 1abfbccc8..9685ea778 100644 --- a/EMS/core-bundle/src/Form/DataField/AssetFieldType.php +++ b/EMS/core-bundle/src/Form/DataField/AssetFieldType.php @@ -147,6 +147,8 @@ public function buildView(FormView $view, FormInterface $form, array $options): */ public function generateMapping(FieldType $current): array { + $mapping = parent::generateMapping($current); + return [ $current->getName() => \array_merge([ 'type' => 'nested', @@ -160,6 +162,7 @@ public function generateMapping(FieldType $current): array EmsFields::CONTENT_FILE_SIZE_FIELD => $this->elasticsearchService->getLongMapping(), EmsFields::CONTENT_FILE_SIZE_FIELD_ => $this->elasticsearchService->getLongMapping(), EmsFields::CONTENT_IMAGE_RESIZED_HASH_FIELD => $this->elasticsearchService->getKeywordMapping(), + EmsFields::CONTENT_FILE_TITLE => $mapping[$current->getName()], ], ], \array_filter($current->getMappingOptions())), ]; diff --git a/EMS/core-bundle/src/Form/Field/AssetType.php b/EMS/core-bundle/src/Form/Field/AssetType.php index 0187da56e..15903a4dc 100644 --- a/EMS/core-bundle/src/Form/Field/AssetType.php +++ b/EMS/core-bundle/src/Form/Field/AssetType.php @@ -51,6 +51,9 @@ public function buildForm(FormBuilderInterface $builder, array $options): void 'class' => 'name', ], 'required' => $options['required'], + ]) + ->add(EmsFields::CONTENT_FILE_TITLE, TextType::class, [ + 'required' => $options['required'], ]); } } diff --git a/EMS/core-bundle/src/Resources/views/form/fields.html.twig b/EMS/core-bundle/src/Resources/views/form/fields.html.twig index de9e6c127..3a27cabf9 100644 --- a/EMS/core-bundle/src/Resources/views/form/fields.html.twig +++ b/EMS/core-bundle/src/Resources/views/form/fields.html.twig @@ -983,6 +983,7 @@ {{- form_row(fileItem.sha1) -}} {{- form_row(fileItem._image_resized_hash) -}} {{- form_row(fileItem.mimetype) -}} + {{- form_row(fileItem._title) -}}