Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- langcode: en
- status: true
- dependencies:
- module:
- - paragraphs
- - text
- id: paragraph.field_accordion_section_title
- field_name: field_accordion_section_title
- entity_type: paragraph
- type: string_long
- settings: { }
- module: text
- locked: false
- cardinality: 1
- translatable: true
- indexes: { }
- persist_with_no_fields: false
- custom_storage: false
- use DrupalfieldEntityFieldConfig;
- use DrupalfieldEntityFieldStorageConfig;
- /**
- * Updates accordion section title to string type.
- */
- function my_module_update_8001() {
- if ($fields = Drupal::entityTypeManager()->getStorage('field_storage_config')->loadByProperties(array('field_name' => 'field_accordion_section_title'))) {
- foreach ($fields as $field) {
- $new_field = $field->toArray();
- $new_field['type'] = 'string_long';
- $new_field = FieldStorageConfig::create($new_field);
- $new_field->original = $field;
- $new_field->enforceIsNew(FALSE);
- $new_field->save();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement