From 1eaf896edd3cd8481139d02211a12a13c0c8a750 Mon Sep 17 00:00:00 2001 From: Marcel Werk Date: Thu, 21 Mar 2019 17:32:59 +0100 Subject: [PATCH] Allow import of articles CLoses #2875 --- .../files/lib/system/importer/ArticleImporter.class.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/wcfsetup/install/files/lib/system/importer/ArticleImporter.class.php b/wcfsetup/install/files/lib/system/importer/ArticleImporter.class.php index 12416385b8..63e29d2a65 100644 --- a/wcfsetup/install/files/lib/system/importer/ArticleImporter.class.php +++ b/wcfsetup/install/files/lib/system/importer/ArticleImporter.class.php @@ -51,11 +51,17 @@ class ArticleImporter extends AbstractImporter { $imageID = ImportHandler::getInstance()->getNewID('com.woltlab.wcf.media', $contentData['imageID']); } + $teaserImageID = null; + if (!empty($contentData['teaserImageID'])) { + $teaserImageID = ImportHandler::getInstance()->getNewID('com.woltlab.wcf.media', $contentData['teaserImageID']); + } + $contents[$languageID] = [ 'title' => (!empty($contentData['title']) ? $contentData['title'] : ''), 'teaser' => (!empty($contentData['teaser']) ? $contentData['teaser'] : ''), 'content' => (!empty($contentData['content']) ? $contentData['content'] : ''), 'imageID' => $imageID, + 'teaserImageID' => $teaserImageID, 'tags' => (!empty($contentData['tags']) ? $contentData['tags'] : []) ]; @@ -95,7 +101,8 @@ class ArticleImporter extends AbstractImporter { 'title' => $contentData['title'], 'teaser' => $contentData['teaser'], 'content' => $contentData['content'], - 'imageID' => $contentData['imageID'] + 'imageID' => $contentData['imageID'], + 'teaserImageID' => $contentData['teaserImageID'] ]); // save tags -- 2.20.1