Inject additional fields to FormBuilderForm::save()
authorJoshua Rüsweg <josh@bastelstu.be>
Thu, 21 Feb 2019 13:50:37 +0000 (14:50 +0100)
committerJoshua Rüsweg <josh@bastelstu.be>
Thu, 21 Feb 2019 13:50:48 +0000 (14:50 +0100)
wcfsetup/install/files/lib/form/AbstractFormBuilderForm.class.php

index f68e7a201eabe7f3d897d4b119ef90e453cb44a6..f088c814181168df109f858526a3bb0e32a3b15f 100644 (file)
@@ -146,11 +146,15 @@ abstract class AbstractFormBuilderForm extends AbstractForm {
                        $action = 'update';
                }
                
+               $formData = $this->form->getData();
+               if (!isset($formData['data'])) $formData['data'] = [];
+               $formData['data'] = array_merge($this->additionalFields, $formData['data']);
+               
                /** @var AbstractDatabaseObjectAction objectAction */
                $this->objectAction = new $this->objectActionClass(
                        array_filter([$this->formObject]),
                        $action,
-                       $this->form->getData()
+                       $formData
                );
                $this->objectAction->executeAction();