From b19dcee8b679895d6cdc75d843804f2ed1e4a6f1 Mon Sep 17 00:00:00 2001 From: Andriy Iun Date: Wed, 5 Aug 2020 11:58:55 +0200 Subject: [PATCH] Added migration support for bootstrap rows and columns. --- os2forms.module | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/os2forms.module b/os2forms.module index 45c26ef3..f9178362 100644 --- a/os2forms.module +++ b/os2forms.module @@ -62,3 +62,34 @@ function os2forms_webform_migrate_d7_webform_element_date_popup_alter(&$markup, } } } + +/** + * Implements hook_webform_migrate_d7_webform_element_ELEMENT_TYPE_alter(). + * + * Not released hook + * @See https://www.drupal.org/project/webform_migrate/issues/3155073 + */ +function os2forms_webform_migrate_d7_webform_element_bt_layout_row_alter(&$markup, $indent, array $element) { + $markup .= "$indent '#type': webform_flexbox\n"; + + $extra = unserialize($element['extra']); + if (!empty($extra['description'])) { + $value = "\"" . str_replace(['"', "\n", "\r"], ["'", '\n', ''], $extra['description']) . "\""; + $markup .= "$indent #description: $value\n"; + } +} + +/** + * Implements hook_webform_migrate_d7_webform_element_ELEMENT_TYPE_alter(). + * + * Not released hook + * @See https://www.drupal.org/project/webform_migrate/issues/3155073 + */ +function os2forms_webform_migrate_d7_webform_element_bt_layout_cols_alter(&$markup, $indent, array $element) { + $markup .= "$indent '#type': container\n"; + $extra = unserialize($element['extra']); + if (!empty($extra['description'])) { + $value = "\"" . str_replace(['"', "\n", "\r"], ["'", '\n', ''], $extra['description']) . "\""; + $markup .= "$indent #description: $value\n"; + } +}