Set attachment support depending on whether `attachmentField` available (#5856)
authorOlaf Braun <olaf_schmitz_1@t-online.de>
Mon, 25 Mar 2024 15:05:55 +0000 (16:05 +0100)
committerGitHub <noreply@github.com>
Mon, 25 Mar 2024 15:05:55 +0000 (16:05 +0100)
wcfsetup/install/files/lib/system/form/builder/container/wysiwyg/WysiwygFormContainer.class.php

index aded5e5cad2fe7a2328672e4f7c123f6b18caa5e..7229153497abb800c9c04a13f45e3b1aed9a149c 100644 (file)
@@ -475,7 +475,6 @@ class WysiwygFormContainer extends FormContainer
             ->minimumLength($this->getMinimumLength())
             ->maximumLength($this->getMaximumLength())
             ->required($this->isRequired())
-            ->supportAttachments($this->attachmentData !== null)
             ->supportMentions($this->supportMentions)
             ->supportQuotes($this->supportQuotes);
         if ($this->quoteData !== null) {
@@ -529,6 +528,7 @@ class WysiwygFormContainer extends FormContainer
         if ($this->attachmentData !== null) {
             $this->setAttachmentHandler();
         }
+        $this->wysiwygField->supportAttachments($this->attachmentField->isAvailable());
 
         if ($this->enablePreviewButton) {
             $this->getDocument()->addButton(