Skip to content

Commit

Permalink
XLIFF Import Publish state fix for ArticleImport (#595)
Browse files Browse the repository at this point in the history
  • Loading branch information
popoplanter authored Nov 11, 2021
1 parent 840ce08 commit aed8acb
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion Import/ArticleImport.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
use Sulu\Bundle\DocumentManagerBundle\Bridge\DocumentInspector;
use Sulu\Component\Content\Compat\Structure\LegacyPropertyFactory;
use Sulu\Component\Content\Compat\StructureManagerInterface;
use Sulu\Component\Content\Document\WorkflowStage;
use Sulu\Component\Content\Extension\ExportExtensionInterface;
use Sulu\Component\Content\Extension\ExtensionInterface;
use Sulu\Component\Content\Extension\ExtensionManagerInterface;
Expand Down Expand Up @@ -182,7 +183,11 @@ protected function importDocument(array $parsedData, string $format, string $loc

// save document
$this->documentManager->persist($document, $locale);
$this->documentManager->publish($document, $locale);

if (WorkflowStage::PUBLISHED === ((int) $this->getParser($format)->getPropertyData('workflowStage', $data))) {
$this->documentManager->publish($document, $locale);
}

$this->documentManager->flush();
$this->documentRegistry->clear();
} catch (\Exception $e) {
Expand Down

0 comments on commit aed8acb

Please sign in to comment.