[BUGFIX] Ensure route defaults and requirements are considered
Changes concerning route `defaults`: + defaults are mapped now (e.g. `1` <=> `one`) + defaults are applied now when having multiple parameters in a route path (e.g. `{default}/{required}` + defaults are applied now for types `Plugin` and `Extbase` (type `Simple` worked in most cases) + enforced defaults are considered now (e.g. `{!default}` + `Route` instances get `_appliedDefault` option set now - which contains deflated values and still needs to be inflated manually Changes concerning route `requirements`: + requirements are deflated now for being processed as Symfony routes (resulting in requirements being correctly applied now in enhancers) + requirements are skipped now for parameters having corresponding aspects defined ("aspects take precedence over requirements") References: + https://symfony.com/blog/new-in-symfony-4-3-always-include-route-default-values + https://symfony.com/doc/4.3/routing.html#parameters-validation + https://symfony.com/doc/4.3/routing.html#optional-parameters Resolves: #86895 Releases: master, 9.5 Change-Id: Ia260e407dcc657a2e7c85628da9e001d94952c37 Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/62885 Tested-by:TYPO3com <noreply@typo3.com> Tested-by:
Susanne Moog <look@susi.dev> Tested-by:
Benni Mack <benni@typo3.org> Reviewed-by:
Susanne Moog <look@susi.dev> Reviewed-by:
Benni Mack <benni@typo3.org>
Showing
- typo3/sysext/core/Classes/Routing/Enhancer/AbstractEnhancer.php 63 additions, 1 deletion...sysext/core/Classes/Routing/Enhancer/AbstractEnhancer.php
- typo3/sysext/core/Classes/Routing/Enhancer/PluginEnhancer.php 8 additions, 3 deletions...3/sysext/core/Classes/Routing/Enhancer/PluginEnhancer.php
- typo3/sysext/core/Classes/Routing/Enhancer/SimpleEnhancer.php 4 additions, 3 deletions...3/sysext/core/Classes/Routing/Enhancer/SimpleEnhancer.php
- typo3/sysext/core/Classes/Routing/PageRouter.php 9 additions, 2 deletionstypo3/sysext/core/Classes/Routing/PageRouter.php
- typo3/sysext/core/Classes/Routing/PageUriMatcher.php 6 additions, 1 deletiontypo3/sysext/core/Classes/Routing/PageUriMatcher.php
- typo3/sysext/core/Classes/Routing/UrlGenerator.php 56 additions, 0 deletionstypo3/sysext/core/Classes/Routing/UrlGenerator.php
- typo3/sysext/core/Documentation/Changelog/9.5.x/Important-86895-RouteAspectsTakePrecedenceOverRequirements.rst 51 additions, 0 deletions...tant-86895-RouteAspectsTakePrecedenceOverRequirements.rst
- typo3/sysext/core/Documentation/Changelog/9.5/Feature-86365-RoutingEnhancersAndAspects.rst 31 additions, 10 deletions...hangelog/9.5/Feature-86365-RoutingEnhancersAndAspects.rst
- typo3/sysext/extbase/Classes/Routing/ExtbasePluginEnhancer.php 9 additions, 12 deletions.../sysext/extbase/Classes/Routing/ExtbasePluginEnhancer.php
- typo3/sysext/frontend/Tests/Functional/SiteHandling/AbstractTestCase.php 1 addition, 1 deletion...ontend/Tests/Functional/SiteHandling/AbstractTestCase.php
- typo3/sysext/frontend/Tests/Functional/SiteHandling/EnhancerLinkGeneratorTest.php 220 additions, 0 deletions...sts/Functional/SiteHandling/EnhancerLinkGeneratorTest.php
- typo3/sysext/frontend/Tests/Functional/SiteHandling/EnhancerSiteRequestTest.php 274 additions, 2 deletions...Tests/Functional/SiteHandling/EnhancerSiteRequestTest.php
Please register or sign in to comment