From 610487330da70e1eada377117adfeb8b8d9cad49 Mon Sep 17 00:00:00 2001 From: Matthias Schmidt Date: Sun, 31 Mar 2019 15:31:07 +0200 Subject: [PATCH] Use `getPrefixedId()` instead of `getId()` in `UplodFormField` See #2509 See #2825 --- .../form/builder/field/UploadFormField.class.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) 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 84ba4d6b03..ffba0d462f 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 @@ -46,7 +46,7 @@ class UploadFormField extends AbstractFormField { * Registers the current field in the upload handler. */ private function registerField() { - if (!UploadHandler::getInstance()->isRegisteredFieldId($this->getId())) { + if (!UploadHandler::getInstance()->isRegisteredFieldId($this->getPrefixedId())) { UploadHandler::getInstance()->registerUploadField($this->buildUploadField()); } } @@ -55,8 +55,8 @@ class UploadFormField extends AbstractFormField { * Unregisters the current field in the upload handler. */ private function unregisterField() { - if (UploadHandler::getInstance()->isRegisteredFieldId($this->getId())) { - UploadHandler::getInstance()->unregisterUploadField($this->getId()); + if (UploadHandler::getInstance()->isRegisteredFieldId($this->getPrefixedId())) { + UploadHandler::getInstance()->unregisterUploadField($this->getPrefixedId()); } } @@ -66,7 +66,7 @@ class UploadFormField extends AbstractFormField { * @return UploadField */ protected function buildUploadField() { - $uploadField = new UploadField($this->getId()); + $uploadField = new UploadField($this->getPrefixedId()); $uploadField->maxFiles = $this->getMaximum(); $uploadField->setImageOnly($this->isImageOnly()); $uploadField->setAllowSvgImage($this->svgImageAllowed()); @@ -80,7 +80,7 @@ class UploadFormField extends AbstractFormField { * @return boolean */ private function isRegistered() { - return UploadHandler::getInstance()->isRegisteredFieldId($this->getId()); + return UploadHandler::getInstance()->isRegisteredFieldId($this->getPrefixedId()); } /** @@ -90,7 +90,7 @@ class UploadFormField extends AbstractFormField { public function getValue() { $this->registerField(); - return UploadHandler::getInstance()->getFilesByFieldId($this->getId()); + return UploadHandler::getInstance()->getFilesByFieldId($this->getPrefixedId()); } /** @@ -102,7 +102,7 @@ class UploadFormField extends AbstractFormField { public function getRemovedFiles($processFiles = false) { $this->registerField(); - return UploadHandler::getInstance()->getRemovedFiledByFieldId($this->getId(), $processFiles); + return UploadHandler::getInstance()->getRemovedFiledByFieldId($this->getPrefixedId(), $processFiles); } /** @@ -209,7 +209,7 @@ class UploadFormField extends AbstractFormField { $this->registerField(); - UploadHandler::getInstance()->registerFilesByField($this->getId(), $value); + UploadHandler::getInstance()->registerFilesByField($this->getPrefixedId(), $value); } /** -- 2.20.1