Set form data only if the form is not submitted
authorJoshua Rüsweg <josh@bastelstu.be>
Tue, 5 Feb 2019 11:26:31 +0000 (12:26 +0100)
committerJoshua Rüsweg <josh@bastelstu.be>
Tue, 5 Feb 2019 11:26:31 +0000 (12:26 +0100)
See #2825
See #2509

wcfsetup/install/files/lib/form/AbstractFormBuilderForm.class.php

index f0f0cd75333ae32bfb36ab9334220471096cb254..03af8da28b23bf211e5a1bc5bab4ccf2c40c75c8 100644 (file)
@@ -110,7 +110,9 @@ abstract class AbstractFormBuilderForm extends AbstractForm {
         */
        public function readData() {
                if ($this->formObject !== null) {
-                       $this->setFormObjectData();
+                       if (empty($_POST)) {
+                               $this->setFormObjectData();
+                       }
                }
                else if ($this->formAction === 'edit') {
                        throw new \UnexpectedValueException("Missing form object to update.");