From 604c79b4f5a5be0a3613b27376063bf8031e2f4b Mon Sep 17 00:00:00 2001 From: Andriy Iun Date: Thu, 13 Aug 2020 09:25:03 +0200 Subject: [PATCH] Fixed SBSYS element yaml generate way. --- modules/os2forms_sbsys/os2forms_sbsys.module | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/modules/os2forms_sbsys/os2forms_sbsys.module b/modules/os2forms_sbsys/os2forms_sbsys.module index a0b5c040..dab48200 100644 --- a/modules/os2forms_sbsys/os2forms_sbsys.module +++ b/modules/os2forms_sbsys/os2forms_sbsys.module @@ -5,6 +5,8 @@ * OS2Forms SBSYS functionality module. */ +use Symfony\Component\Yaml\Yaml; + /** * Implements hook_migrate_prepare_row(). */ @@ -50,8 +52,8 @@ function os2forms_sbsys_migrate_prepare_row(\Drupal\migrate\Row $row, \Drupal\mi if (!empty($data[$property])) { $value = $data[$property]; if ($value == 'custom') { - $os2forms_sbsys['#' . $property . '_custom'] = $data[$property . '_custom']; - $os2forms_sbsys['#' . $property] = $value; + $os2forms_sbsys['#' . $property . '_custom'] = Yaml::dump($data[$property . '_custom'], 2, 1); + $os2forms_sbsys['#' . $property] = '_custom_'; } else { $os2forms_sbsys['#' . $property] = $keys[$value]; @@ -68,7 +70,7 @@ function os2forms_sbsys_migrate_prepare_row(\Drupal\migrate\Row $row, \Drupal\mi $markup .= " '#title': 'SBSYS Attachment'\n"; $markup .= " '#type': webform_attachment_os2forms_sbsys_xml\n"; foreach ($os2forms_sbsys as $key => $value) { - $markup .= " '$key': '$value'\n"; + $markup .= " '$key': $value\n"; } $elements = $row->getSourceProperty('elements'); $elements .= $markup;