Project

General

Profile

Actions

Epic #88528

closed

Remove switchable controller action functionality

Added by Alexander Schnitzler over 5 years ago. Updated 5 months ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Extbase
Start date:
2019-06-08
Due date:
% Done:

100%

Estimated time:
(Total: 0.00 h)
Sprint Focus:

Description

Switchable controller actions are a way to override the controller-action-pairs – configured during the call to \TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin and/or \TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerModule – during runtime, mostly achieved by implementing a select element in a the flexform of a plugin. The actual configuration is therefore stored in the database and most likely very different from what can be seen in ext_localconf.php

Why have switchable controller actions been introduced?

Well, there are several different issues these switchable controller actions:

Allow setting both the default controller and the default action dynamically

Since there is a feature in Extbase called skipDefaultArguments, URL's do not need to contain the GET parameters for the controller and the action if the target controller and action are the default ones. This feature has been introduced to ease the pain of configuring nice URL's with realurl.

Allow to set custom controller-action-pairs for 3rd-party-extensions

Imagine you are using an extension that has a fixed configuration of controller-action-pairs and you would like to extend controller of said extension to add another action. In this case you could define a flexform for the plugin and override the configuration in there. It's not only possible to get rid of GET parameters that reflect default values of plugins, it's also possible to allow/disallow actions for controllers that have been disallowed/allowed previously.

Why should we get rid of switchable controller actions?

Well, the problem with this "feature" is, that configuration can be changed during runtime, which

  • Source code is not the single source of truth
  • Configuration can no longer be properly versioned (Git/SVN/...)
  • Configuration can not be properly cached and displayed for debugging.

How can/should/will we get rid of switchable controller actions?

There are quite a few different steps to take here:

  • First of all, we need to remove the restriction, that only configured pairs of controllers and their actions are allowed to be called. This will be done to remove the necessity to use switchable controller actions to allow non-configured controller-action-pairs. Using the configuration as some kind of firewall is an anti pattern anyway. Authentication and Authorization have to be implemented differently. Nevertheless, this change needs to be communicated very well because people might rely on actions not being callable.
  • Next, the switchable controller actions defined via flexform will only be used to determine the default controller and its default action. Switchable controller actions may still define a list of actions, but only the first one will be evaluted to determine the default action.
  • Then, skipDefaultArguments will be deprecated. This indicates that from TYPO3 version 11 on, links will no longer be created with missing GET parameters for both default controllers and default actions. To avoid having those params in links, route enhancer configurations have to be used and/or adjusted.
  • In TYPO3 version 11, switchable controller actions will no longer be evaluted to determine default controller or default action. All links need to contain a controller and action parameter.
  • Also, in TYPO3 version 11, \TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin and \TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerModule will no longer accept a list of actions for (cached) controllers. Both methods will accept a list of allowed controllers and a list of uncached actions. The exact api is not yet defined as of this writing. Idea of Benni Mack: Actions could be marked uncached with a doctrine annotation.

Issues that need to be solved

  • If there are two different plugins (with the same namespace like Pi1) on one page, both defining a different default action via switchable controller actions, the removal of the switchable controller actions leads to the problem, that one GET parameter defines the default action for both plugins. This means, that there still needs to be a way to set the default action other than via GET params.

Subtasks 2 (0 open2 closed)

Task #88529: Plugin configuration does no longer determine callable actions.Rejected2019-06-08

Actions
Task #89463: Deprecate switchable controller actionsClosedAlexander Schnitzler2019-10-21

Actions

Related issues 9 (1 open8 closed)

Related to TYPO3 Core - Bug #71569: FrontendConfigurationManager::overrideSwitchableControllerActionsFromFlexForm does not check if plugin has flexformClosed2015-11-13

Actions
Related to TYPO3 Core - Bug #73630: flexform data is not deleted when changing pluginAccepted2016-02-23

Actions
Related to TYPO3 Core - Bug #80365: Document switchableControllerActionsClosed2017-03-21

Actions
Related to TYPO3 Core - Bug #73795: Bug when switching a extbase plugin with flexforms "switchableControllerActions" to a plugin without flexformClosed2016-03-01

Actions
Related to TYPO3 Core - Bug #70378: switchableControllerActions overrides configuration of non-cacheable actionsClosed2015-10-05

Actions
Related to TYPO3 Core - Bug #80101: Extbase getContentObject() gets no result by calling in another controllerClosed2017-03-02

Actions
Related to TYPO3 Core - Task #88496: Replace switchable controller actions terminologyClosedAlexander Schnitzler2019-06-05

Actions
Related to TYPO3 Core - Task #96282: Remove extbase switchable controller actionsClosed2021-12-07

Actions
Related to TYPO3 Core - Task #91118: Fix Changelog 89463 - Switchable Controller ActionsClosed2020-04-18

Actions
Actions #1

Updated by Alexander Schnitzler over 5 years ago

  • Description updated (diff)
Actions #2

Updated by Alexander Schnitzler over 5 years ago

  • Description updated (diff)
Actions #3

Updated by Alexander Schnitzler about 5 years ago

  • Related to Bug #71569: FrontendConfigurationManager::overrideSwitchableControllerActionsFromFlexForm does not check if plugin has flexform added
Actions #4

Updated by Alexander Schnitzler about 5 years ago

  • Related to Bug #73630: flexform data is not deleted when changing plugin added
Actions #5

Updated by Riccardo De Contardi about 5 years ago

  • Related to Bug #80365: Document switchableControllerActions added
Actions #6

Updated by Georg Ringer almost 5 years ago

  • Status changed from New to In Progress
Actions #7

Updated by Christian Eßl almost 5 years ago

  • Related to Bug #73795: Bug when switching a extbase plugin with flexforms "switchableControllerActions" to a plugin without flexform added
Actions #8

Updated by Christian Eßl almost 5 years ago

  • Related to Bug #70378: switchableControllerActions overrides configuration of non-cacheable actions added
Actions #9

Updated by Christian Eßl almost 5 years ago

  • Related to Bug #80101: Extbase getContentObject() gets no result by calling in another controller added
Actions #10

Updated by Riccardo De Contardi over 4 years ago

  • Related to Task #88496: Replace switchable controller actions terminology added
Actions #11

Updated by Christian Kuhn almost 3 years ago

  • Related to Task #96282: Remove extbase switchable controller actions added
Actions #12

Updated by Christian Kuhn almost 3 years ago

  • Related to Task #91118: Fix Changelog 89463 - Switchable Controller Actions added
Actions #13

Updated by Stefan Froemken over 1 year ago

Hello Alexander,

thank you for this great work which is IMO done since ~3 years.
What do you think? Can we close this epic issue?

Nice greetings

Stefan

Actions #14

Updated by Christian Kuhn over 1 year ago

  • Status changed from In Progress to Resolved
Actions #15

Updated by Benni Mack 5 months ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF