Allow import of articles
authorMarcel Werk <burntime@woltlab.com>
Thu, 21 Mar 2019 16:32:59 +0000 (17:32 +0100)
committerMarcel Werk <burntime@woltlab.com>
Thu, 21 Mar 2019 16:32:59 +0000 (17:32 +0100)
CLoses #2875

wcfsetup/install/files/lib/system/importer/ArticleImporter.class.php

index 12416385b8ff640198438c21668fa6778c021fab..63e29d2a654a6eaa73415326bb6afe3ccfb3cad4 100644 (file)
@@ -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