From e60987a37fa2d611ea626a4b8f1a582e7e9d4884 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Joshua=20R=C3=BCsweg?= Date: Sun, 20 Jan 2019 22:37:01 +0100 Subject: [PATCH] Set object property to null See #2825 --- .../form/builder/field/UploadFormField.class.php | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/wcfsetup/install/files/lib/system/form/builder/field/UploadFormField.class.php b/wcfsetup/install/files/lib/system/form/builder/field/UploadFormField.class.php index 6b98265fee..40d625c58f 100644 --- a/wcfsetup/install/files/lib/system/form/builder/field/UploadFormField.class.php +++ b/wcfsetup/install/files/lib/system/form/builder/field/UploadFormField.class.php @@ -58,6 +58,7 @@ class UploadFormField extends AbstractFormField { $uploadField = new UploadField($this->getId()); $uploadField->maxFiles = $this->getMaximum(); $uploadField->setImageOnly($this->isImageOnly()); + $uploadField->setAllowSvgImages($this->isImageOnly()); return $uploadField; } @@ -76,9 +77,18 @@ class UploadFormField extends AbstractFormField { * @return UploadFile[] */ public function getValue() { + $this->registerField(); + return UploadHandler::getInstance()->getFilesByFieldId($this->getId()); } + /** + * @inheritDoc + */ + public function getObjectProperty() { + return null; + } + /** * @inheritDoc */ @@ -181,7 +191,7 @@ class UploadFormField extends AbstractFormField { /** * Sets the imageOnly flag for this field. * - * @param boolean $imageOnly maximum field value + * @param boolean $imageOnly * @return static this field */ public function imageOnly($imageOnly = true) { -- 2.20.1