Remove obsolete parameters from `getControllerLink()` controller-link-parameters
authorMarcel Werk <burntime@woltlab.com>
Wed, 20 Nov 2024 14:20:32 +0000 (15:20 +0100)
committerMarcel Werk <burntime@woltlab.com>
Wed, 20 Nov 2024 14:20:32 +0000 (15:20 +0100)
The parameters are obsolete as they always result from the given controller class.

wcfsetup/install/files/lib/form/AbstractFormBuilderForm.class.php
wcfsetup/install/files/lib/system/request/LinkHandler.class.php

index 5a708838cc81816a5569e0bd5ca6e664cb4e6845..0448bd25295a2207b1fb22454be247463444217a 100644 (file)
@@ -71,6 +71,7 @@ abstract class AbstractFormBuilderForm extends AbstractForm
      * name of the application for the link to the edit form
      * @var string
      * @since 5.3
+     * @deprecated 6.2 No longer in use.
      */
     public $objectEditLinkApplication = 'wcf';
 
@@ -194,7 +195,6 @@ abstract class AbstractFormBuilderForm extends AbstractForm
             WCF::getTPL()->assign(
                 'objectEditLink',
                 LinkHandler::getInstance()->getControllerLink($this->objectEditLinkController, [
-                    'application' => $this->objectEditLinkApplication,
                     'id' => $this->objectAction->getReturnValues()['returnValues']->getObjectID(),
                 ])
             );
index bf111a0c44acd90a9094784eae7e4fec207588d6..c2fd3bfd4f98828e6da709b4a9ff4a0d9c55235c 100644 (file)
@@ -83,10 +83,10 @@ final class LinkHandler extends SingletonFactory
 
         $matches = $this->controllerRegex->getMatches();
 
-        // important: matches cannot overwrite explicitly set parameters
-        $parameters['application'] = $parameters['application'] ?? $matches['application'];
-        $parameters['isACP'] = $parameters['isACP'] ?? $matches['isAcp'];
-        $parameters['forceFrontend'] = $parameters['forceFrontend'] ?? !$matches['isAcp'];
+        // Overwrite legacy parameters, as these always result from the given controller class.
+        $parameters['application'] = $matches['application'];
+        $parameters['isACP'] = $matches['isAcp'];
+        $parameters['forceFrontend'] = !$matches['isAcp'];
 
         return $this->getLink($matches['controller'], $parameters, $url);
     }