Fix dbo action name for edit form builder forms
authorMatthias Schmidt <gravatronics@live.com>
Mon, 3 Dec 2018 18:21:12 +0000 (19:21 +0100)
committerMatthias Schmidt <gravatronics@live.com>
Mon, 3 Dec 2018 18:21:12 +0000 (19:21 +0100)
See #2509

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

index bd314564a5e3545cf4d26238397dca6e432d43ba..4adb25d7b08c70bba6cb321b20e52231adf723c4 100644 (file)
@@ -136,10 +136,18 @@ abstract class AbstractFormBuilderForm extends AbstractForm {
        public function save() {
                parent::save();
                
+               $action = $this->formAction;
+               if ($this->objectActionName) {
+                       $action = $this->objectActionName;
+               }
+               else if ($this->formAction === 'edit') {
+                       $action = 'update';
+               }
+               
                /** @var AbstractDatabaseObjectAction objectAction */
                $this->objectAction = new $this->objectActionClass(
                        array_filter([$this->formObject]),
-                       $this->objectActionName ?: $this->formAction,
+                       $action,
                        $this->form->getData()
                );
                $this->objectAction->executeAction();