Project

General

Profile

Actions

Bug #88631

open

Page type parameter is ignored in POST requests/parameters

Added by DMK E-BUSINESS GmbH almost 5 years ago. Updated over 3 years ago.

Status:
Accepted
Priority:
Should have
Assignee:
-
Category:
Frontend
Start date:
2019-06-26
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
9
PHP Version:
7.2
Tags:
Complexity:
Is Regression:
Sprint Focus:

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?

Actions #1

Updated by Benni Mack almost 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.

Actions #2

Updated by DMK E-BUSINESS GmbH almost 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.

Actions #3

Updated by Tobias Schmidt almost 4 years ago

I can confirm this bug still exists in TYPO3 10.3.

Actions #4

Updated by Tobias Schmidt almost 4 years ago

Any chance this gets fixed rather soon?

Actions #5

Updated by Tobias Schmidt over 3 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',

Actions #6

Updated by Martin Weymayer over 3 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

Actions

Also available in: Atom PDF