Skip to content

Commit

Permalink
Fix PositionSelect export when inside a Matrix or SuperTable.
Browse files Browse the repository at this point in the history
  • Loading branch information
spAnser committed Feb 28, 2017
1 parent 1947a80 commit 611d9fb
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions thearchitect/services/TheArchitectService.php
Original file line number Diff line number Diff line change
Expand Up @@ -2713,6 +2713,13 @@ private function setMatrixField(&$newField, $fieldId, $includeID = false)
'type' => $blockField->type,
'typesettings' => $blockField->settings,
];
if ($blockField->type == 'PositionSelect') {
$options = [];
foreach ($blockField->settings['options'] as $value) {
$options[$value] = true;
}
$newField['typesettings']['blockTypes'][$blockId]['fields'][$fieldId]['typesettings']['options'] = $options;
}
if ($blockField->type == 'Neo') {
$this->setNeoField($newField['typesettings']['blockTypes'][$blockId]['fields'][$fieldId], $blockField->id, $includeID);
}
Expand Down Expand Up @@ -2818,6 +2825,13 @@ private function setSuperTableField(&$newField, $fieldId, $includeID = false)
'width' => $columns[$sTFieldCount - 1]['width'],
'typesettings' => $sTField->settings,
];
if ($sTField->type == 'PositionSelect') {
$options = [];
foreach ($sTField->settings['options'] as $value) {
$options[$value] = true;
}
$newField['typesettings']['blockTypes'][$blockId]['fields'][$fieldId]['typesettings']['options'] = $options;
}
if ($sTField->type == 'Matrix') {
$this->setMatrixField($newField['typesettings']['blockTypes'][$blockId]['fields'][$fieldId], $sTField->id);
}
Expand Down

0 comments on commit 611d9fb

Please sign in to comment.