From d015bd988244bdd0d9ee89357e26bb41503b4b1b Mon Sep 17 00:00:00 2001 From: Matthias Schmidt Date: Sun, 10 Mar 2019 15:12:23 +0100 Subject: [PATCH] Fix minor issues in `WysiwygFormContainer` See #2852 --- .../wysiwyg/WysiwygFormContainer.class.php | 48 +++++++++---------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/wcfsetup/install/files/lib/system/form/builder/container/wysiwyg/WysiwygFormContainer.class.php b/wcfsetup/install/files/lib/system/form/builder/container/wysiwyg/WysiwygFormContainer.class.php index 553ef12e6a..af4c1fe15e 100644 --- a/wcfsetup/install/files/lib/system/form/builder/container/wysiwyg/WysiwygFormContainer.class.php +++ b/wcfsetup/install/files/lib/system/form/builder/container/wysiwyg/WysiwygFormContainer.class.php @@ -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; -- 2.20.1