From: Olaf Braun Date: Fri, 22 Dec 2023 13:20:54 +0000 (+0100) Subject: Reload content after save (#5737) X-Git-Tag: 6.0.5_dev_1~8 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=6afe50077f6479e68c13f19731bf326d3fcf6ce0;p=GitHub%2FWoltLab%2FWCF.git Reload content after save (#5737) * Reload content after save * Insert null check * Reload content in pages after save * Reload content in box after save * Fix comment message * Correct check if input processor exists --- diff --git a/wcfsetup/install/files/lib/acp/form/ArticleEditForm.class.php b/wcfsetup/install/files/lib/acp/form/ArticleEditForm.class.php index 417e0f07e3..636f9a7644 100644 --- a/wcfsetup/install/files/lib/acp/form/ArticleEditForm.class.php +++ b/wcfsetup/install/files/lib/acp/form/ArticleEditForm.class.php @@ -144,6 +144,16 @@ class ArticleEditForm extends ArticleAddForm // call saved event $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]) ? + $this->htmlInputProcessors[$language->languageID]->getHtml() : ''; + } + } else { + $this->content[0] = isset($this->htmlInputProcessors[0]) ? $this->htmlInputProcessors[0]->getHtml() : ''; + } + // show success message WCF::getTPL()->assign('success', true); } diff --git a/wcfsetup/install/files/lib/acp/form/BoxEditForm.class.php b/wcfsetup/install/files/lib/acp/form/BoxEditForm.class.php index 020b2670d9..28f238440f 100644 --- a/wcfsetup/install/files/lib/acp/form/BoxEditForm.class.php +++ b/wcfsetup/install/files/lib/acp/form/BoxEditForm.class.php @@ -174,6 +174,16 @@ class BoxEditForm extends BoxAddForm // call saved event $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]) ? + $this->htmlInputProcessors[$language->languageID]->getHtml() : ''; + } + } else { + $this->content[0] = isset($this->htmlInputProcessors[0]) ? $this->htmlInputProcessors[0]->getHtml() : ''; + } + // show success message WCF::getTPL()->assign('success', true); } diff --git a/wcfsetup/install/files/lib/acp/form/PageEditForm.class.php b/wcfsetup/install/files/lib/acp/form/PageEditForm.class.php index 8691942073..adaaeddb35 100644 --- a/wcfsetup/install/files/lib/acp/form/PageEditForm.class.php +++ b/wcfsetup/install/files/lib/acp/form/PageEditForm.class.php @@ -259,6 +259,16 @@ class PageEditForm extends PageAddForm // call saved event $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]) ? + $this->htmlInputProcessors[$language->languageID]->getHtml() : ''; + } + } else { + $this->content[0] = isset($this->htmlInputProcessors[0]) ? $this->htmlInputProcessors[0]->getHtml() : ''; + } + // show success message WCF::getTPL()->assign('success', true); }