Skip to content
Snippets Groups Projects
Commit d572562d authored by Oliver Hader's avatar Oliver Hader Committed by Oliver Hader
Browse files

[BUGFIX] Allow routes without actual route variables for ExtbaseEnhancer

The route configuration shown below using `ExtbaseEnhancer` is currently
not evaluated anymore due to missing route variables in `routePath`. For
this particular case in `ExtbaseEnhancer` the controller-action pair is
implicitly defining variables.

MyPlugin:
  type: Extbase
  extension: ...
  plugin: ...
  routes:
    -
      routePath: '/action'
      _controller: 'MyController::action'

Resolves: #91880
Releases: master, 10.4, 9.5
Change-Id: Ib42f87c3c9f83acc7f2ceec4a93169d15777ed08
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/65134


Tested-by: default avatarMarkus Klein <markus.klein@typo3.org>
Tested-by: default avatarTYPO3com <noreply@typo3.com>
Tested-by: default avatarMarco Bresch <marco.bresch@starfinanz.de>
Tested-by: default avatarGeorg Tiefenbrunn <georg.tiefenbrunn@gmail.com>
Tested-by: default avatarOliver Hader <oliver.hader@typo3.org>
Reviewed-by: default avatarMarkus Klein <markus.klein@typo3.org>
Reviewed-by: default avatarGeorg Tiefenbrunn <georg.tiefenbrunn@gmail.com>
Reviewed-by: Oliver Hader <...
parent b1d796f6
Branches
Tags
No related merge requests found
......@@ -147,7 +147,9 @@ class ExtbasePluginEnhancer extends PluginEnhancer
$variables = array_flip($compiledRoute->getPathVariables());
$mergedParams = array_replace($variant->getDefaults(), $deflatedParameters);
// all params must be given, otherwise we exclude this variant
if ($variables === [] || array_diff_key($variables, $mergedParams) !== []) {
// (it is allowed that $variables is empty - in this case variables are
// "given" implicitly through controller-action pair in `_controller`)
if (array_diff_key($variables, $mergedParams)) {
continue;
}
$variant->addOptions(['deflatedParameters' => $deflatedParameters]);
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment