diff --git a/src/PortlandLabs/Concrete5/MigrationTool/Publisher/Command/Handler/PublishStackContentCommandHandler.php b/src/PortlandLabs/Concrete5/MigrationTool/Publisher/Command/Handler/PublishStackContentCommandHandler.php index 5e525226..4e3a7bb5 100644 --- a/src/PortlandLabs/Concrete5/MigrationTool/Publisher/Command/Handler/PublishStackContentCommandHandler.php +++ b/src/PortlandLabs/Concrete5/MigrationTool/Publisher/Command/Handler/PublishStackContentCommandHandler.php @@ -76,7 +76,22 @@ public function execute(BatchInterface $batch, LoggerInterface $logger) } $value = $importBlock->getBlockValue(); $publisher = $value->getPublisher(); - $publisher->publish($batch, $blockType, $stack, STACKS_AREA_NAME, $value); + $ccmBlock = $publisher->publish($batch, $blockType, $stack, STACKS_AREA_NAME, $value); + if (!is_object($ccmBlock)) { + $ccmBlock = null; + } + if ($ccmBlock !== null) { + $styleSet = $importBlock->getStyleSet(); + if (is_object($styleSet)) { + $styleSetPublisher = $styleSet->getPublisher(); + $publishedStyleSet = $styleSetPublisher->publish(); + $ccmBlock->setCustomStyleSet($publishedStyleSet); + } + $customTemplate = (string) $importBlock->getCustomTemplate(); + if ($customTemplate !== '') { + $ccmBlock->setCustomTemplate($customTemplate); + } + } } } }