Bug #88631
openPage type parameter is ignored in POST requests/parameters
0%
Description
Since TYPO3 9 the page type parameter is ignored when set in POST parameters (for example from a form field). If it's set in GET parameters (query string) everything is fine. This is because the PageArguments object is instantiated at several points with only the type parameter from the query params (for example in \TYPO3\CMS\Frontend\Middleware\PageResolver) not respecting the POST parameters. On the other hand the TypoScriptFrontendController is instantiated in \TYPO3\CMS\Frontend\Middleware\TypoScriptFrontendInitialization with GeneralUtility::_GP('type') handling both POST and GET parameters. This is inconsistent behaviour and should be fixed as soon as possible. Or is this intended and not a bug?
Updated by Benni Mack over 5 years ago
- Status changed from New to Accepted
definitively a bug. However, I wonder how the URL to the page is generated (via <f:form> in fluid or typolink?). This would be great so we can add proper tests to it.
Updated by DMK E-BUSINESS GmbH over 5 years ago
The link to the page is generated with a typolink but has no type parameter. The type parameter is added to the POST request through JavaScript as the request is done with Ajax.
Updated by Tobias Schmidt over 4 years ago
I can confirm this bug still exists in TYPO3 10.3.
Updated by Tobias Schmidt over 4 years ago
Any chance this gets fixed rather soon?
Updated by Tobias Schmidt over 4 years ago
As a workaround one can add the type parameter to the url and still send the form data with POST:
jQuery.ajax({
async: true,
url: url + 'additional/pathsegment/?type=123456789',
type: 'POST',
data: formData
});
This is probably not just a workaround but the way it should be done. One could add a page type suffix mapping for the type value in the routing configuration to create a speaking url: url + 'additional/pathsegment/status.json',
Updated by Martin Weymayer almost 4 years ago
If you have routeEnhancers like this, you have to add your typNum:
PageTypeSuffix:
type: PageType
default: /
suffix: /
index: ''
map:
/: 0
f.E.
add:
ajaxCart: 2278001