From e7860127cc911d227cfab6f80a6a50ddc7afc2e6 Mon Sep 17 00:00:00 2001 From: Keegan Rankin Date: Thu, 21 Mar 2024 14:25:49 -0700 Subject: [PATCH] Add field media document to the file paragraph and deprecate field file --- ...ty_form_display.paragraph.file.default.yml | 19 ++++++++---- ...ty_view_display.paragraph.file.default.yml | 14 +++++---- .../field.field.paragraph.file.field_file.yml | 6 ++-- ...ld.paragraph.file.field_media_document.yml | 29 +++++++++++++++++++ config/field.storage.paragraph.field_file.yml | 2 +- ...storage.paragraph.field_media_document.yml | 20 +++++++++++++ 6 files changed, 74 insertions(+), 16 deletions(-) create mode 100644 config/field.field.paragraph.file.field_media_document.yml create mode 100644 config/field.storage.paragraph.field_media_document.yml diff --git a/config/core.entity_form_display.paragraph.file.default.yml b/config/core.entity_form_display.paragraph.file.default.yml index 3d3f5de..bb4c1b1 100644 --- a/config/core.entity_form_display.paragraph.file.default.yml +++ b/config/core.entity_form_display.paragraph.file.default.yml @@ -4,9 +4,10 @@ status: true dependencies: config: - field.field.paragraph.file.field_file + - field.field.paragraph.file.field_media_document - paragraphs.paragraphs_type.file module: - - file + - media_library_media_modify _core: default_config_hash: 47c_p3_AKkkCabhYVnOWmPVzSp8BmBg5ERP84VO4EM0 id: paragraph.file.default @@ -14,14 +15,20 @@ targetEntityType: paragraph bundle: file mode: default content: - field_file: + field_media_document: + type: media_library_media_modify_widget weight: 0 - settings: - progress_indicator: throbber - third_party_settings: { } - type: file_generic region: content + settings: + media_types: { } + form_mode: default + check_selected: false + replace_checkbox_by_order_indicator: false + multi_edit_on_create: false + no_edit_on_create: false + third_party_settings: { } hidden: created: true + field_file: true status: true uid: true diff --git a/config/core.entity_view_display.paragraph.file.default.yml b/config/core.entity_view_display.paragraph.file.default.yml index 4d15f2c..8a81472 100644 --- a/config/core.entity_view_display.paragraph.file.default.yml +++ b/config/core.entity_view_display.paragraph.file.default.yml @@ -4,9 +4,8 @@ status: true dependencies: config: - field.field.paragraph.file.field_file + - field.field.paragraph.file.field_media_document - paragraphs.paragraphs_type.file - module: - - file _core: default_config_hash: 7APNi5gpaAg2_8CMsnLPZDur8I52PYdXwRHzYO3SLbg id: paragraph.file.default @@ -14,12 +13,15 @@ targetEntityType: paragraph bundle: file mode: default content: - field_file: - weight: 0 + field_media_document: + type: entity_reference_entity_view label: hidden - settings: { } + settings: + view_mode: default + link: false third_party_settings: { } - type: file_default + weight: 0 region: content hidden: + field_file: true search_api_excerpt: true diff --git a/config/field.field.paragraph.file.field_file.yml b/config/field.field.paragraph.file.field_file.yml index ecf03fb..ca9f7a1 100644 --- a/config/field.field.paragraph.file.field_file.yml +++ b/config/field.field.paragraph.file.field_file.yml @@ -13,17 +13,17 @@ id: paragraph.file.field_file field_name: field_file entity_type: paragraph bundle: file -label: File +label: 'File (deprecated)' description: '' required: false translatable: false default_value: { } default_value_callback: '' settings: + handler: 'default:file' + handler_settings: { } file_directory: '[date:custom:Y]-[date:custom:m]' file_extensions: 'txt pdf odt doc docx' max_filesize: '' description_field: true - handler: 'default:file' - handler_settings: { } field_type: file diff --git a/config/field.field.paragraph.file.field_media_document.yml b/config/field.field.paragraph.file.field_media_document.yml new file mode 100644 index 0000000..f336444 --- /dev/null +++ b/config/field.field.paragraph.file.field_media_document.yml @@ -0,0 +1,29 @@ +uuid: 01a41180-36f8-4cd9-9341-2e620b276a62 +langcode: en +status: true +dependencies: + config: + - field.storage.paragraph.field_media_document + - media.type.document + - paragraphs.paragraphs_type.file +id: paragraph.file.field_media_document +field_name: field_media_document +entity_type: paragraph +bundle: file +label: 'Media document' +description: '' +required: false +translatable: false +default_value: { } +default_value_callback: '' +settings: + handler: 'default:media' + handler_settings: + target_bundles: + document: document + sort: + field: _none + direction: ASC + auto_create: false + auto_create_bundle: '' +field_type: entity_reference diff --git a/config/field.storage.paragraph.field_file.yml b/config/field.storage.paragraph.field_file.yml index 619b75a..3243cb6 100644 --- a/config/field.storage.paragraph.field_file.yml +++ b/config/field.storage.paragraph.field_file.yml @@ -12,10 +12,10 @@ field_name: field_file entity_type: paragraph type: file settings: + target_type: file display_field: false display_default: false uri_scheme: public - target_type: file module: file locked: false cardinality: -1 diff --git a/config/field.storage.paragraph.field_media_document.yml b/config/field.storage.paragraph.field_media_document.yml new file mode 100644 index 0000000..af52e54 --- /dev/null +++ b/config/field.storage.paragraph.field_media_document.yml @@ -0,0 +1,20 @@ +uuid: 0f9ff95d-5877-47b0-a77c-01f835ddeedc +langcode: en +status: true +dependencies: + module: + - media + - paragraphs +id: paragraph.field_media_document +field_name: field_media_document +entity_type: paragraph +type: entity_reference +settings: + target_type: media +module: core +locked: false +cardinality: 1 +translatable: true +indexes: { } +persist_with_no_fields: false +custom_storage: false