Bug #30778

Exceeding Request arguments should only be appended to URI if configured

Added by Bastian Waidelich almost 4 years ago. Updated almost 4 years ago.

Status:Resolved Start date:2011-10-11
Priority:Should have Due date:
Assigned To:Bastian Waidelich % Done:

100%

Category:MVC - Routing
Target version:TYPO3 Flow Base Distribution - 1.0.0
PHP Version: Complexity:
Has patch: Affected Flow version:

Description

Currently when creating URIs/Links via the UriBuilder arguments that are not part of the configured route values are appended to the resulting URI as query string. This makes it difficult to get a reliable behavior.
Example:
Given following Routes.yaml

 1-
 2  uriPattern: 'foo/static'
 3  defaults:
 4    '@package':    'Acme.Demo'
 5    '@controller': 'Standard'
 6    '@action':     'index'
 7
 8-
 9  uriPattern: 'foo/{dynamic}'
10  defaults:
11    '@package':    'Acme.Demo'
12    '@controller': 'Standard'
13    '@action':     'index'

Now <f:uri.action action="index" arguments="{dynamic: 'bar'}" /> would result in the URI foo/static?dynamic=bar.
This could be solved by moving the second route above the first one, but than the matching wouldn't work as expected because the URI foo/static would match the dynamic route then.

We do need the feature of appended query strings for fallback routes and if you want to explicitly use them.
As a solution I'd suggest to append the exceeding arguments only when configured in the respective route:

1-
2  uriPattern: 'foo/{dynamic}'
3  defaults:
4    '@package':    'Acme.Demo'
5    '@controller': 'Standard'
6    '@action':     'index'
7  appendExceedingArguments: true


Related issues

related to TYPO3.Flow - Task #35394: Document Routing feature "appendExceedingArguments" Resolved 2012-03-30

Associated revisions

Revision d74ce5d9
Added by Bastian Waidelich almost 4 years ago

[!!!][TASK] Only append exceeding request arguments to URI if configured

This changes the default behavior of the routing framework in
order to be more consequent and easier to extend in the future.
In detail this changes handling of arguments that are passed to
the router::resolve() method but are not part of the route
configuration.
Until now these arguments were just appended to the resulting
URI as query string, but this leads to unexpected behavior (see

Now, if you need this behavior, you have to explicitly tell the
route by enabling the setting "appendExceedingArguments".
This is done for the default action route provided with FLOW3,
so that most links will work out of the box.

Change-Id: I5fcb3b583cc237957337e1d94731695e51afcc45
Resolves: #30778

History

#1 Updated by Mr. Hudson almost 4 years ago

  • Status changed from New to Under Review

Patch set 1 of change I5fcb3b583cc237957337e1d94731695e51afcc45 has been pushed to the review server.
It is available at http://review.typo3.org/5779

#2 Updated by Mr. Hudson almost 4 years ago

Patch set 2 of change I5fcb3b583cc237957337e1d94731695e51afcc45 has been pushed to the review server.
It is available at http://review.typo3.org/5779

#3 Updated by Mr. Hudson almost 4 years ago

Patch set 3 of change I5fcb3b583cc237957337e1d94731695e51afcc45 has been pushed to the review server.
It is available at http://review.typo3.org/5779

#4 Updated by Bastian Waidelich almost 4 years ago

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

#5 Updated by Karsten Dambekalns almost 4 years ago

  • Target version changed from 1230 to 1.0.0

Also available in: Atom PDF