Convert string field to text field (allows formats) with fixed length in Drupal 10
See https://www.drupal.org/project/migration_helpers/issues/3404674
Needed to manually change config, but it imported fine, and then i could set the allowed formats.
This much trouble almost makes me want to go back to my hack where the string field is just a string and the format is set globally not per every saved field, since we lock it anyway
diff --git a/config/sync/field.storage.media.field_credit.yml b/config/sync/field.storage.media.field_credit.yml
index 29fd6d4..40543e2 100644
--- a/config/sync/field.storage.media.field_credit.yml
+++ b/config/sync/field.storage.media.field_credit.yml
@@ -4,13 +4,14 @@ status: true
dependencies:
module:
- media
+ - text
id: media.field_credit
field_name: field_credit
entity_type: media
type: text
settings:
max_length: 2040
-module: core
+module: text
locked: false
cardinality: 1
translatable: true
(1/1) Stage this hunk [y,n,q,a,d,s,e,?]? y
diff --git a/config/sync/field.storage.media.field_title.yml b/config/sync/field.storage.media.field_title.yml
index 8f3ae34..8f6b830 100644
--- a/config/sync/field.storage.media.field_title.yml
+++ b/config/sync/field.storage.media.field_title.yml
@@ -4,13 +4,14 @@ status: true
dependencies:
module:
- media
+ - text
id: media.field_title
field_name: field_title
entity_type: media
type: text
settings:
max_length: 2040
-module: core
+module: text
locked: false
cardinality: 1
translatable: true
diff --git a/config/sync/field.field.media.image.field_credit.yml b/config/sync/field.field.media.image.field_credit.yml
index b384aba..8462146 100644
--- a/config/sync/field.field.media.image.field_credit.yml
+++ b/config/sync/field.field.media.image.field_credit.yml
@@ -5,6 +5,8 @@ dependencies:
config:
- field.storage.media.field_credit
- media.type.image
+ module:
+ - text
id: media.image.field_credit
field_name: field_credit
entity_type: media
@@ -17,4 +19,4 @@ default_value: { }
default_value_callback: ''
settings:
allowed_formats: { }
-field_type: string
+field_type: text
diff --git a/config/sync/field.field.media.image.field_title.yml b/config/sync/field.field.media.image.field_title.yml
index 0952b7e..0113abe 100644
--- a/config/sync/field.field.media.image.field_title.yml
+++ b/config/sync/field.field.media.image.field_title.yml
@@ -5,6 +5,8 @@ dependencies:
config:
- field.storage.media.field_title
- media.type.image
+ module:
+ - text
id: media.image.field_title
field_name: field_title
entity_type: media
@@ -17,4 +19,4 @@ default_value: { }
default_value_callback: ''
settings:
allowed_formats: { }
-field_type: string
+field_type: text