Skip to content

Commit

Permalink
feat: add _title in revision form
Browse files Browse the repository at this point in the history
  • Loading branch information
theus77 committed Oct 25, 2024
1 parent 45d74e3 commit 3de01bd
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions EMS/core-bundle/src/Form/DataField/AssetFieldType.php
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ 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',
Expand All @@ -160,6 +161,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())),
];
Expand Down
3 changes: 3 additions & 0 deletions EMS/core-bundle/src/Form/Field/AssetType.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'],
]);
}
}
Expand Down
1 change: 1 addition & 0 deletions EMS/core-bundle/src/Resources/views/form/fields.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -983,6 +983,7 @@
{{- form_row(fileItem.sha1) -}}
{{- form_row(fileItem._image_resized_hash) -}}
{{- form_row(fileItem.mimetype) -}}
{{- form_row(fileItem._title) -}}
</div>
</div>
<div class="modal-footer">
Expand Down

0 comments on commit 3de01bd

Please sign in to comment.