Use LinkHandler::getControllerLink() in AbstractFormBuilderForm
authorMatthias Schmidt <gravatronics@live.com>
Sun, 24 Feb 2019 13:25:51 +0000 (14:25 +0100)
committerMatthias Schmidt <gravatronics@live.com>
Sun, 24 Feb 2019 13:25:51 +0000 (14:25 +0100)
See #2509

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

index f088c814181168df109f858526a3bb0e32a3b15f..bc51930f04311de8dbc80f4d40e4077771bd0da9 100644 (file)
@@ -181,11 +181,7 @@ abstract class AbstractFormBuilderForm extends AbstractForm {
         * Sets the action of the form.
         */
        protected function setFormAction() {
-               $classNamePieces = explode('\\', get_class($this));
-               $application = $classNamePieces[0];
-               $controller = preg_replace('~Form$~', '', end($classNamePieces));
-               
-               $parameters = ['application' => $application];
+               $parameters = [];
                if ($this->formObject !== null) {
                        if ($this->formObject instanceof IRouteController) {
                                $parameters['object'] = $this->formObject;
@@ -197,7 +193,7 @@ abstract class AbstractFormBuilderForm extends AbstractForm {
                        }
                }
                
-               $this->form->action(LinkHandler::getInstance()->getLink($controller, $parameters));
+               $this->form->action(LinkHandler::getInstance()->getControllerLink(static::class, $parameters));
        }
        
        /**