From 526f01976d1051292f6177b42d3a62f74f31050d Mon Sep 17 00:00:00 2001 From: D34dMan Date: Tue, 11 Aug 2020 23:59:43 +0200 Subject: [PATCH 1/9] Add text module dependencies to family of text fields --- src/transformers/Utils/templates/field/rich_text/view.yml | 7 +++++++ src/transformers/Utils/templates/field/string/view.yml | 4 ++++ .../Utils/templates/field/string_long/view.yml | 4 ++++ src/transformers/Utils/templates/field/text/view.yml | 4 ++++ src/transformers/Utils/templates/field/text_long/view.yml | 4 ++++ 5 files changed, 23 insertions(+) diff --git a/src/transformers/Utils/templates/field/rich_text/view.yml b/src/transformers/Utils/templates/field/rich_text/view.yml index 2e0feb7..9c2fbb0 100644 --- a/src/transformers/Utils/templates/field/rich_text/view.yml +++ b/src/transformers/Utils/templates/field/rich_text/view.yml @@ -1,4 +1,11 @@ +dependencies: + default: + module: + - text content: default: label: hidden region: content + type: text_default + __|settings: { } + __|third_party_settings: { } diff --git a/src/transformers/Utils/templates/field/string/view.yml b/src/transformers/Utils/templates/field/string/view.yml index 985b82d..98ef470 100644 --- a/src/transformers/Utils/templates/field/string/view.yml +++ b/src/transformers/Utils/templates/field/string/view.yml @@ -1,3 +1,7 @@ +dependencies: + default: + module: + - text content: default: weight: 0 diff --git a/src/transformers/Utils/templates/field/string_long/view.yml b/src/transformers/Utils/templates/field/string_long/view.yml index 985b82d..98ef470 100644 --- a/src/transformers/Utils/templates/field/string_long/view.yml +++ b/src/transformers/Utils/templates/field/string_long/view.yml @@ -1,3 +1,7 @@ +dependencies: + default: + module: + - text content: default: weight: 0 diff --git a/src/transformers/Utils/templates/field/text/view.yml b/src/transformers/Utils/templates/field/text/view.yml index fafbd79..5090b24 100644 --- a/src/transformers/Utils/templates/field/text/view.yml +++ b/src/transformers/Utils/templates/field/text/view.yml @@ -1,3 +1,7 @@ +dependencies: + default: + module: + - text content: default: weight: 0 diff --git a/src/transformers/Utils/templates/field/text_long/view.yml b/src/transformers/Utils/templates/field/text_long/view.yml index fafbd79..5090b24 100644 --- a/src/transformers/Utils/templates/field/text_long/view.yml +++ b/src/transformers/Utils/templates/field/text_long/view.yml @@ -1,3 +1,7 @@ +dependencies: + default: + module: + - text content: default: weight: 0 From 7a66604867372acaa33dfdf61154dde00d8c76d3 Mon Sep 17 00:00:00 2001 From: D34dMan Date: Tue, 18 Aug 2020 09:08:54 +0200 Subject: [PATCH 2/9] Add support for reference/group --- .../field/entity_reference/group/field.yml | 23 +++++++++++++++++++ .../field/entity_reference/group/form.yml | 11 +++++++++ .../field/entity_reference/group/storage.yml | 19 +++++++++++++++ .../field/entity_reference/group/view.yml | 10 ++++++++ 4 files changed, 63 insertions(+) create mode 100644 src/transformers/Utils/templates/field/entity_reference/group/field.yml create mode 100644 src/transformers/Utils/templates/field/entity_reference/group/form.yml create mode 100644 src/transformers/Utils/templates/field/entity_reference/group/storage.yml create mode 100644 src/transformers/Utils/templates/field/entity_reference/group/view.yml diff --git a/src/transformers/Utils/templates/field/entity_reference/group/field.yml b/src/transformers/Utils/templates/field/entity_reference/group/field.yml new file mode 100644 index 0000000..4584308 --- /dev/null +++ b/src/transformers/Utils/templates/field/entity_reference/group/field.yml @@ -0,0 +1,23 @@ +uuid: e8664aa0-a5c0-4804-8ee1-6132f175942d +langcode: en +status: true +dependencies: +id: block_content.anchor.field_ref_content +field_name: field_ref_content +entity_type: block_content +bundle: anchor +label: 'Ref Content' +description: '' +required: false +translatable: false +default_value: { } +default_value_callback: '' +settings: + handler: 'default:group' + handler_settings: + sort: + field: badge_name + direction: ASC + auto_create: false + auto_create_bundle: '' +field_type: entity_reference diff --git a/src/transformers/Utils/templates/field/entity_reference/group/form.yml b/src/transformers/Utils/templates/field/entity_reference/group/form.yml new file mode 100644 index 0000000..26a4907 --- /dev/null +++ b/src/transformers/Utils/templates/field/entity_reference/group/form.yml @@ -0,0 +1,11 @@ +content: + default: + weight: 27 + __|settings: + match_operator: CONTAINS + match_limit: 10 + size: 60 + placeholder: '' + __|third_party_settings: { } + type: entity_reference_autocomplete + region: content diff --git a/src/transformers/Utils/templates/field/entity_reference/group/storage.yml b/src/transformers/Utils/templates/field/entity_reference/group/storage.yml new file mode 100644 index 0000000..562f58d --- /dev/null +++ b/src/transformers/Utils/templates/field/entity_reference/group/storage.yml @@ -0,0 +1,19 @@ +uuid: b6768c60-7e4e-43a1-9853-0c45029331f6 +langcode: en +status: true +dependencies: + module: + - group +id: block_content.field_ref_content +field_name: field_ref_content +entity_type: block_content +type: entity_reference +settings: + target_type: group +module: core +locked: false +cardinality: 1 +translatable: true +indexes: { } +persist_with_no_fields: false +custom_storage: false diff --git a/src/transformers/Utils/templates/field/entity_reference/group/view.yml b/src/transformers/Utils/templates/field/entity_reference/group/view.yml new file mode 100644 index 0000000..af87c79 --- /dev/null +++ b/src/transformers/Utils/templates/field/entity_reference/group/view.yml @@ -0,0 +1,10 @@ +content: + default: + weight: 1 + label: hidden + settings: + view_mode: teaser + link: false + third_party_settings: { } + type: entity_reference_entity_view + region: content From f8445b96afa1b09146780ae56b4292e527b23f06 Mon Sep 17 00:00:00 2001 From: D34dman Date: Sat, 22 Aug 2020 21:54:46 +0200 Subject: [PATCH 3/9] Remove sorting config from media browser as it leads to error --- src/transformers/Utils/Plugins/EntityReferenceFieldField.php | 1 - .../Utils/templates/field/entity_reference/media/field.yml | 3 ++- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/transformers/Utils/Plugins/EntityReferenceFieldField.php b/src/transformers/Utils/Plugins/EntityReferenceFieldField.php index efe1e34..d5720d9 100644 --- a/src/transformers/Utils/Plugins/EntityReferenceFieldField.php +++ b/src/transformers/Utils/Plugins/EntityReferenceFieldField.php @@ -54,7 +54,6 @@ protected function getTemplateOverrideData() case 'media': if ($bundles) { $data['settings']['handler_settings']['target_bundles'] = $bundles; - $data['settings']['handler_settings']['sort']['field'] = $this->getFieldName().'.title'; foreach ($bundles as $bundle) { $data['dependencies']['config'][] = 'media.type.'.$bundle; } diff --git a/src/transformers/Utils/templates/field/entity_reference/media/field.yml b/src/transformers/Utils/templates/field/entity_reference/media/field.yml index f87ece6..1ad6d2d 100644 --- a/src/transformers/Utils/templates/field/entity_reference/media/field.yml +++ b/src/transformers/Utils/templates/field/entity_reference/media/field.yml @@ -15,8 +15,9 @@ default_value_callback: '' settings: handler: 'default:media' handler_settings: + target_bundles: sort: - field: title + field: _none direction: ASC auto_create: false auto_create_bundle: '' From 718b4c508e5b08e37f7ce7e523dcc262cc3a9761 Mon Sep 17 00:00:00 2001 From: D34dman Date: Sun, 23 Aug 2020 11:02:00 +0200 Subject: [PATCH 4/9] BUGFIX radios and select to have proper reference to modules they depends on --- src/transformers/Utils/templates/field/radios/view.yml | 9 +++++++++ src/transformers/Utils/templates/field/select/view.yml | 9 +++++++++ 2 files changed, 18 insertions(+) diff --git a/src/transformers/Utils/templates/field/radios/view.yml b/src/transformers/Utils/templates/field/radios/view.yml index 2e0feb7..ff2b802 100644 --- a/src/transformers/Utils/templates/field/radios/view.yml +++ b/src/transformers/Utils/templates/field/radios/view.yml @@ -1,4 +1,13 @@ +dependencies: + default: + module: + - link + - options + content: default: label: hidden region: content + type: list_default + __|settings: { } + __|third_party_settings: { } diff --git a/src/transformers/Utils/templates/field/select/view.yml b/src/transformers/Utils/templates/field/select/view.yml index 2e0feb7..ff2b802 100644 --- a/src/transformers/Utils/templates/field/select/view.yml +++ b/src/transformers/Utils/templates/field/select/view.yml @@ -1,4 +1,13 @@ +dependencies: + default: + module: + - link + - options + content: default: label: hidden region: content + type: list_default + __|settings: { } + __|third_party_settings: { } From 8db25b8089de2999429a99112709983975952a9f Mon Sep 17 00:00:00 2001 From: D34dman Date: Tue, 25 Aug 2020 12:23:36 +0200 Subject: [PATCH 5/9] Restrict text-long format to plain_text --- src/transformers/Utils/templates/field/text_long/field.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/transformers/Utils/templates/field/text_long/field.yml b/src/transformers/Utils/templates/field/text_long/field.yml index 3859bfe..571f118 100644 --- a/src/transformers/Utils/templates/field/text_long/field.yml +++ b/src/transformers/Utils/templates/field/text_long/field.yml @@ -14,4 +14,8 @@ translatable: false default_value: { } default_value_callback: '' __|settings: { } +__|third_party_settings: + allowed_formats: + plain_text: plain_text + stripped_html: '0' field_type: text_long From f8d906fa2a9d9d6224545a50cd2182a5aeaa544b Mon Sep 17 00:00:00 2001 From: D34dman Date: Tue, 25 Aug 2020 12:23:36 +0200 Subject: [PATCH 6/9] Revert "Restrict text-long format to plain_text" This reverts commit 8db25b8089de2999429a99112709983975952a9f. --- src/transformers/Utils/templates/field/text_long/field.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/transformers/Utils/templates/field/text_long/field.yml b/src/transformers/Utils/templates/field/text_long/field.yml index 571f118..3859bfe 100644 --- a/src/transformers/Utils/templates/field/text_long/field.yml +++ b/src/transformers/Utils/templates/field/text_long/field.yml @@ -14,8 +14,4 @@ translatable: false default_value: { } default_value_callback: '' __|settings: { } -__|third_party_settings: - allowed_formats: - plain_text: plain_text - stripped_html: '0' field_type: text_long From 7ff09ab7e00fa819203ec3add91e9c83089fe8d0 Mon Sep 17 00:00:00 2001 From: D34dman Date: Tue, 25 Aug 2020 22:51:42 +0200 Subject: [PATCH 7/9] Add support for entityreference/block --- .../Plugins/EntityReferenceFieldField.php | 9 ++++++- .../field/entity_reference/block/field.yml | 26 +++++++++++++++++++ .../field/entity_reference/block/form.yml | 23 ++++++++++++++++ .../field/entity_reference/block/storage.yml | 19 ++++++++++++++ .../field/entity_reference/block/view.yml | 10 +++++++ 5 files changed, 86 insertions(+), 1 deletion(-) create mode 100644 src/transformers/Utils/templates/field/entity_reference/block/field.yml create mode 100644 src/transformers/Utils/templates/field/entity_reference/block/form.yml create mode 100644 src/transformers/Utils/templates/field/entity_reference/block/storage.yml create mode 100644 src/transformers/Utils/templates/field/entity_reference/block/view.yml diff --git a/src/transformers/Utils/Plugins/EntityReferenceFieldField.php b/src/transformers/Utils/Plugins/EntityReferenceFieldField.php index d5720d9..eed2baa 100644 --- a/src/transformers/Utils/Plugins/EntityReferenceFieldField.php +++ b/src/transformers/Utils/Plugins/EntityReferenceFieldField.php @@ -59,7 +59,14 @@ protected function getTemplateOverrideData() } } break; - + case 'block': + if ($bundles) { + $data['settings']['handler_settings']['target_bundles'] = $bundles; + foreach ($bundles as $bundle) { + $data['dependencies']['config'][] = 'block_content.type.' . $bundle; + } + } + break; case 'paragraphs': if ($bundles) { $data['settings']['handler_settings']['target_bundles'] = $bundles; diff --git a/src/transformers/Utils/templates/field/entity_reference/block/field.yml b/src/transformers/Utils/templates/field/entity_reference/block/field.yml new file mode 100644 index 0000000..fad3454 --- /dev/null +++ b/src/transformers/Utils/templates/field/entity_reference/block/field.yml @@ -0,0 +1,26 @@ +uuid: d1cc117e-06cc-4c13-81eb-11497ac9eb44 +langcode: en +status: true +dependencies: + config: + module: + - entity_reference +id: block_content.textarea.field_key_facts +field_name: field_key_facts +entity_type: block_content +bundle: textarea +label: 'Key Facts' +description: '' +required: false +translatable: true +default_value: { } +default_value_callback: '' +settings: + handler: 'default:block_content' + handler_settings: + target_bundles: + sort: + field: _none + auto_create: false + auto_create_bundle: '' +field_type: entity_reference diff --git a/src/transformers/Utils/templates/field/entity_reference/block/form.yml b/src/transformers/Utils/templates/field/entity_reference/block/form.yml new file mode 100644 index 0000000..54152e9 --- /dev/null +++ b/src/transformers/Utils/templates/field/entity_reference/block/form.yml @@ -0,0 +1,23 @@ +dependencies: + default: + module: +content: + default: + weight: 2 + settings: + form_mode: default + revision: true + label_singular: '' + label_plural: '' + collapsible: false + collapsed: false + allow_new: true + match_operator: CONTAINS + allow_duplicate: false + override_labels: false + allow_existing: false + third_party_settings: + entity_browser_entity_form: + entity_browser_id: _none + type: inline_entity_form_complex + region: content \ No newline at end of file diff --git a/src/transformers/Utils/templates/field/entity_reference/block/storage.yml b/src/transformers/Utils/templates/field/entity_reference/block/storage.yml new file mode 100644 index 0000000..261a71b --- /dev/null +++ b/src/transformers/Utils/templates/field/entity_reference/block/storage.yml @@ -0,0 +1,19 @@ +uuid: 6531995d-7896-45f8-806d-ffdd90b41b8d +langcode: en +status: true +dependencies: + module: + - block_content +id: block_content.field_key_facts +field_name: field_key_facts +entity_type: block_content +type: entity_reference +settings: + target_type: block_content +module: core +locked: false +cardinality: 1 +translatable: true +indexes: { } +persist_with_no_fields: false +custom_storage: false diff --git a/src/transformers/Utils/templates/field/entity_reference/block/view.yml b/src/transformers/Utils/templates/field/entity_reference/block/view.yml new file mode 100644 index 0000000..a26bc5a --- /dev/null +++ b/src/transformers/Utils/templates/field/entity_reference/block/view.yml @@ -0,0 +1,10 @@ +content: + default: + weight: 2 + label: hidden + __|settings: + view_mode: default + link: false + __|third_party_settings: { } + type: entity_reference_entity_view + region: content \ No newline at end of file From 39d08dba34a8e59f4ba916a0cf74d4dcced5e46d Mon Sep 17 00:00:00 2001 From: D34dman Date: Tue, 25 Aug 2020 22:52:17 +0200 Subject: [PATCH 8/9] BUGFIX : text_long should use text_textarea --- src/transformers/Utils/templates/field/text_long/form.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/transformers/Utils/templates/field/text_long/form.yml b/src/transformers/Utils/templates/field/text_long/form.yml index 2c46097..b86809d 100644 --- a/src/transformers/Utils/templates/field/text_long/form.yml +++ b/src/transformers/Utils/templates/field/text_long/form.yml @@ -5,5 +5,5 @@ content: size: 60 placeholder: '' __|third_party_settings: { } - type: text_textfield + type: text_textarea region: content From bc1d8d20c0d409771063de0e604e8b4e80107cee Mon Sep 17 00:00:00 2001 From: D34dman Date: Tue, 15 Sep 2020 22:30:23 +0200 Subject: [PATCH 9/9] Use textarea for string_long --- src/transformers/Utils/templates/field/string_long/field.yml | 4 ++-- src/transformers/Utils/templates/field/string_long/view.yml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) mode change 100644 => 100755 src/transformers/Utils/templates/field/string_long/field.yml mode change 100644 => 100755 src/transformers/Utils/templates/field/string_long/view.yml diff --git a/src/transformers/Utils/templates/field/string_long/field.yml b/src/transformers/Utils/templates/field/string_long/field.yml old mode 100644 new mode 100755 index b8ae2d0..31e7f7b --- a/src/transformers/Utils/templates/field/string_long/field.yml +++ b/src/transformers/Utils/templates/field/string_long/field.yml @@ -7,11 +7,11 @@ id: node.test_node.field_string_example field_name: field_string_example entity_type: node bundle: test_node -label: string_example +label: Copy description: '' required: false translatable: false default_value: { } default_value_callback: '' __|settings: { } -field_type: string +field_type: string_long diff --git a/src/transformers/Utils/templates/field/string_long/view.yml b/src/transformers/Utils/templates/field/string_long/view.yml old mode 100644 new mode 100755 index 98ef470..db16010 --- a/src/transformers/Utils/templates/field/string_long/view.yml +++ b/src/transformers/Utils/templates/field/string_long/view.yml @@ -9,5 +9,5 @@ content: __|settings: link_to_entity: false __|third_party_settings: { } - type: string + type: basic_string region: content