From: Matthias Schmidt Date: Sun, 31 Mar 2019 13:31:07 +0000 (+0200) Subject: Use `getPrefixedId()` instead of `getId()` in `UplodFormField` X-Git-Tag: 5.2.0_Alpha_1~176^2~3 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=610487330da70e1eada377117adfeb8b8d9cad49;p=GitHub%2FWoltLab%2FWCF.git Use `getPrefixedId()` instead of `getId()` in `UplodFormField` See #2509 See #2825 --- 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); } /**