Cleanup form in the `saved` method
authorJoshua Rüsweg <josh@bastelstu.be>
Mon, 28 Jan 2019 15:34:46 +0000 (16:34 +0100)
committerJoshua Rüsweg <josh@bastelstu.be>
Mon, 28 Jan 2019 15:34:46 +0000 (16:34 +0100)
See #2509

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

index 60f64e9b41625074a13ba37ee37ece0030f86b71..f0f0cd75333ae32bfb36ab9334220471096cb254 100644 (file)
@@ -154,14 +154,21 @@ abstract class AbstractFormBuilderForm extends AbstractForm {
                
                $this->saved();
                
+               WCF::getTPL()->assign('success', true);
+       }
+       
+       /**
+        * @inheritDoc
+        */
+       public function saved() {
+               parent::saved();
+               
                // re-build form after having created a new object
                if ($this->formAction === 'create') {
                        $this->form->cleanup();
                        
                        $this->buildForm();
                }
-               
-               WCF::getTPL()->assign('success', true);
        }
        
        /**