Pages in the Template format were not imported correctly
authorMarcel Werk <burntime@woltlab.com>
Tue, 15 Jun 2021 11:23:53 +0000 (13:23 +0200)
committerMarcel Werk <burntime@woltlab.com>
Tue, 15 Jun 2021 11:23:53 +0000 (13:23 +0200)
wcfsetup/install/files/lib/system/importer/PageImporter.class.php

index 37e1523dd4d2314c095f4afec49b48b24effbb72..006aa5075f0541957e93d3b25d8af23d76edfd5d 100644 (file)
@@ -63,11 +63,10 @@ class PageImporter extends AbstractImporter {
                }
                
                // save page
-               $page = PageEditor::create($data);
+               $page = new PageEditor(PageEditor::create($data));
                if (!$page->identifier) {
                        // set generic page identifier
-                       $pageEditor = new PageEditor($page);
-                       $pageEditor->update([
+                       $page->update([
                                'identifier' => 'com.woltlab.wcf.generic'.$page->pageID
                        ]);
                }
@@ -84,6 +83,10 @@ class PageImporter extends AbstractImporter {
                                'customURL' => $contentData['customURL'],
                                'hasEmbeddedObjects' => $contentData['hasEmbeddedObjects']
                        ]);
+                       
+                       if ($page->pageType == 'tpl') {
+                               $page->updateTemplate($languageID ?: null, $contentData['content']);
+                       }
                }
                
                ImportHandler::getInstance()->saveNewID('com.woltlab.wcf.page', $oldID, $page->pageID);