Only reload content if content type `text`
authorCyperghost <olaf_schmitz_1@t-online.de>
Tue, 2 Jan 2024 12:08:40 +0000 (13:08 +0100)
committerCyperghost <olaf_schmitz_1@t-online.de>
Tue, 2 Jan 2024 12:08:40 +0000 (13:08 +0100)
wcfsetup/install/files/lib/acp/form/BoxEditForm.class.php
wcfsetup/install/files/lib/acp/form/PageEditForm.class.php

index 28f238440fc814a58b3f8420db2a490ac269c27a..b8a15904d83f484cef0d31d4c610337a975d5750 100644 (file)
@@ -175,13 +175,16 @@ class BoxEditForm extends BoxAddForm
         $this->saved();
 
         // Ensure that the CKEditor has the correct content after save.
-        if ($this->isMultilingual) {
-            foreach (LanguageFactory::getInstance()->getLanguages() as $language) {
-                $this->content[$language->languageID] = isset($this->htmlInputProcessors[$language->languageID]) ?
+        if ($this->boxType == 'text') {
+            if ($this->isMultilingual) {
+                foreach (LanguageFactory::getInstance()->getLanguages() as $language) {
+                    $this->content[$language->languageID] = isset($this->htmlInputProcessors[$language->languageID]) ?
                     $this->htmlInputProcessors[$language->languageID]->getHtml() : '';
+                }
+            } else {
+                $this->content[0] = isset($this->htmlInputProcessors[0]) ?
+                    $this->htmlInputProcessors[0]->getHtml() : '';
             }
-        } else {
-            $this->content[0] = isset($this->htmlInputProcessors[0]) ? $this->htmlInputProcessors[0]->getHtml() : '';
         }
 
         // show success message
index adaaeddb35e7a4e43ca5b994ee4c16036e85788c..0bd26e01fdb16c4416b6e04bcfcf6d7601636bfd 100644 (file)
@@ -260,13 +260,16 @@ class PageEditForm extends PageAddForm
         $this->saved();
 
         // Ensure that the CKEditor has the correct content after save.
-        if ($this->isMultilingual) {
-            foreach (LanguageFactory::getInstance()->getLanguages() as $language) {
-                $this->content[$language->languageID] = isset($this->htmlInputProcessors[$language->languageID]) ?
+        if ($this->pageType == 'text') {
+            if ($this->isMultilingual) {
+                foreach (LanguageFactory::getInstance()->getLanguages() as $language) {
+                    $this->content[$language->languageID] = isset($this->htmlInputProcessors[$language->languageID]) ?
                     $this->htmlInputProcessors[$language->languageID]->getHtml() : '';
+                }
+            } else {
+                $this->content[0] = isset($this->htmlInputProcessors[0]) ?
+                    $this->htmlInputProcessors[0]->getHtml() : '';
             }
-        } else {
-            $this->content[0] = isset($this->htmlInputProcessors[0]) ? $this->htmlInputProcessors[0]->getHtml() : '';
         }
 
         // show success message