Use `getPrefixedId()` instead of `getId()` in `UplodFormField`
authorMatthias Schmidt <gravatronics@live.com>
Sun, 31 Mar 2019 13:31:07 +0000 (15:31 +0200)
committerMatthias Schmidt <gravatronics@live.com>
Sun, 31 Mar 2019 13:31:07 +0000 (15:31 +0200)
See #2509
See #2825

wcfsetup/install/files/lib/system/form/builder/field/UploadFormField.class.php

index 84ba4d6b033e0bbb5b02d44791f4528e5f24b803..ffba0d462f5ee7016ef677a84150872717555b34 100644 (file)
@@ -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);
        }
        
        /**