Bug #91880

Routing for actions without parameters broken

Added by Robert Vock 16 days ago. Updated 4 days ago.

Status:
Resolved
Priority:
Should have
Assignee:
-
Category:
Link Handling, Site Handling & Routing
Target version:
-
Start date:
2020-07-28
Due date:
% Done:

100%

TYPO3 Version:
9
PHP Version:
Tags:
Complexity:
medium
Is Regression:
Yes
Sprint Focus:

Description

I have the following Routing Configuration:

  RegistrationPlugin:
    type: Extbase
    extension: SfRegister
    plugin: Form
    defaultController: 'FeuserCreate::form'
    routes:
      -
        routePath: '/'
        _controller: 'FeuserCreate::form'
      -
        routePath: '/speichern'
        _controller: 'FeuserCreate::save'
      -
        routePath: '/bestaetigen/{user}/{hash}'
        _controller: 'FeuserCreate::confirm'
        _arguments:
          user: user
          hash: hash

Until TYPO3 9.5.19 this generated pretty URLs for the save action:
/registrierung/speichern

With TYPO3 9.5.20 Update the controller and action parameters are not encoded anymore:
/registrierung?tx_sfregister_form%5Baction%5D=save&tx_sfregister_form%5Bcontroller%5D=FeuserCreate&cHash=d0b4e36e4798e4ce992891ce20b160f9

It appears this bug has been introduced with #90924:
ExtbasePluginEnhancer.php:149

If I change the condition, the URL works fine:

if ($diff = array_diff_key($variables, $mergedParams)) {


Related issues

Related to TYPO3 Core - Bug #90924: Maximum route parameters always appended Resolved 2020-04-01

Associated revisions

Revision d572562d (diff)
Added by Oliver Hader 4 days ago

[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: Markus Klein <>
Tested-by: TYPO3com <>
Tested-by: Marco Bresch <>
Tested-by: Georg Tiefenbrunn <>
Tested-by: Oliver Hader <>
Reviewed-by: Markus Klein <>
Reviewed-by: Georg Tiefenbrunn <>
Reviewed-by: Oliver Hader <>

Revision 20beca46 (diff)
Added by Oliver Hader 4 days ago

[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/+/65232
Tested-by: TYPO3com <>
Tested-by: Oliver Hader <>
Reviewed-by: Oliver Hader <>

Revision f5de2b47 (diff)
Added by Oliver Hader 3 days ago

[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/+/65233
Tested-by: TYPO3com <>
Tested-by: Oliver Hader <>
Reviewed-by: Georg Ringer <>
Reviewed-by: Oliver Hader <>

History

#1 Updated by Robert Vock 16 days ago

  • Related to Bug #90924: Maximum route parameters always appended added

#2 Updated by Oliver Hader 16 days ago

Good catch, in the case of ExtbaseEnhancer path variables are implicitly given at least for the controller/action pair. Thus, fine for ExtbaseEnhancer to remove the $variables === [] guard.

#3 Updated by Oliver Hader 16 days ago

  • Status changed from New to Accepted
  • Complexity set to medium

#4 Updated by Gerrit Code Review 16 days ago

  • Status changed from Accepted to Under Review

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/65134

#5 Updated by Gerrit Code Review 4 days ago

Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/65134

#6 Updated by Gerrit Code Review 4 days ago

Patch set 1 for branch 10.4 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/65232

#7 Updated by Gerrit Code Review 4 days ago

Patch set 1 for branch 9.5 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/65233

#8 Updated by Oliver Hader 4 days ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100

Also available in: Atom PDF