Skip to content

Commit

Permalink
Fixed SBSYS element yaml generate way.
Browse files Browse the repository at this point in the history
  • Loading branch information
andriyun committed Aug 13, 2020
1 parent 92fc881 commit 604c79b
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions modules/os2forms_sbsys/os2forms_sbsys.module
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
* OS2Forms SBSYS functionality module.
*/

use Symfony\Component\Yaml\Yaml;

/**
* Implements hook_migrate_prepare_row().
*/
Expand Down Expand Up @@ -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];
Expand All @@ -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;
Expand Down

0 comments on commit 604c79b

Please sign in to comment.