Fix minor issues in `WysiwygFormContainer`
authorMatthias Schmidt <gravatronics@live.com>
Sun, 10 Mar 2019 14:12:23 +0000 (15:12 +0100)
committerMatthias Schmidt <gravatronics@live.com>
Sun, 10 Mar 2019 14:12:23 +0000 (15:12 +0100)
See #2852

wcfsetup/install/files/lib/system/form/builder/container/wysiwyg/WysiwygFormContainer.class.php

index 553ef12e6a9744749d01f558c82f51012c7646cc..af4c1fe15e76df48e9f6db08d61f9160cbc62686 100644 (file)
@@ -150,27 +150,6 @@ class WysiwygFormContainer extends FormContainer {
                return $this;
        }
        
-       /**
-        * @inheritDoc
-        */
-       public function loadValuesFromObject(IStorableObject $object) {
-               $this->objectId = $object->getObjectID();
-               
-               if ($this->attachmentData !== null) {
-                       // updated attachment handler with object id
-                       $this->attachmentField->attachmentHandler(
-                               new AttachmentHandler(
-                                       $this->attachmentData['objectType'],
-                                       $this->getObjectId(),
-                                       '.',
-                                       $this->attachmentData['parentObjectID']
-                               )
-                       );
-               }
-               
-               return parent::loadValuesFromObject($object);
-       }
-
        /**
         * Sets the attachment-related data used to create an `AttachmentHandler` object for the
         * attachment form field. If no attachment data is set, attachments are not supported.
@@ -326,16 +305,37 @@ class WysiwygFormContainer extends FormContainer {
                return $this;
        }
        
+       /**
+        * @inheritDoc
+        */
+       public function loadValuesFromObject(IStorableObject $object) {
+               $this->objectId = $object->getObjectID();
+               
+               if ($this->attachmentData !== null) {
+                       // updated attachment handler with object id
+                       $this->attachmentField->attachmentHandler(
+                               new AttachmentHandler(
+                                       $this->attachmentData['objectType'],
+                                       $this->getObjectId(),
+                                       '.',
+                                       $this->attachmentData['parentObjectID']
+                               )
+                       );
+               }
+               
+               return parent::loadValuesFromObject($object);
+       }
+       
        /**
         * Sets the poll object type used by the poll form field container.
         * 
         * By default, no poll object type is set, thus the poll form field container is not available.
-        *
+        * 
         * @param       string          $pollObjectType         poll object type for wysiwyg form field
         * @return      WysiwygFormContainer                    this container
         * @throws      \InvalidArgumentException               if the given string is no poll object type
         */
-       public function pollObjectType($pollObjectType = true) {
+       public function pollObjectType($pollObjectType) {
                if (ObjectTypeCache::getInstance()->getObjectTypeByName('com.woltlab.wcf.poll', $pollObjectType) === null) {
                        throw new \InvalidArgumentException("Unknown poll object type '{$pollObjectType}'.");
                }
@@ -468,7 +468,7 @@ class WysiwygFormContainer extends FormContainer {
         */
        public function supportSmilies($supportSmilies = true) {
                if ($this->smiliesContainer !== null) {
-                       throw new \BadMethodCallException("The smilies form container has already been initialized. Use the smilies container directly to manipulate poll support.");
+                       throw new \BadMethodCallException("The smilies form container has already been initialized. Use the smilies container directly to manipulate smiley support.");
                }
                
                $this->supportSmilies = $supportSmilies;