Project

General

Profile

Actions

Bug #81293

closed

cacheHash fails to be generated because of missing id although id is present in request-string

Added by David Bascom almost 7 years ago. Updated over 5 years ago.

Status:
Closed
Priority:
-- undefined --
Assignee:
Category:
Extbase
Target version:
-
Start date:
2017-05-22
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
8
PHP Version:
7.0
Tags:
Complexity:
easy
Is Regression:
Sprint Focus:

Description

An error #1467983513: ID parameter needs to be passed for the cHash calculation! is thrown in certain cases although id is present in GET-query (see screenshot for example).

Reason: In sysext/extbase/Classes/Mvc/Web/CacheHashEnforcer.php->enforceForRequest() on line 66 this function is called:

$this->cacheHashCalculator->getRelevantParameters(
    http_build_query($parameters)
)

http_build_query() builds the query using the urlencoded & instead of a simple "&". The query-string is then passed to sysext/frontend/Classes/Page/CacheHashCalculator.php->splitQueryStringToArray() which uses an simple & to explode the parameters again: explode('&', ...) and convert them back to an associative array:

     $parameters = array_filter(explode('&', ltrim($queryString, '?')));

This leads to an error, because the id-parameter can not be extracted correctly in some cases.
To solve the problem, the line in sysext/extbase/Classes/Mvc/Web/CacheHashEnforcer.php->enforceForRequest() needs to be corrected to:

$this->cacheHashCalculator->getRelevantParameters(
    http_build_query($parameters, '', '&')
)

Files

Bildschirmfoto 2017-05-22 um 11.46.39.png (195 KB) Bildschirmfoto 2017-05-22 um 11.46.39.png David Bascom, 2017-05-22 12:01
exception.jpg (170 KB) exception.jpg Carsten Falkenberg, 2017-05-23 16:42

Related issues 3 (0 open3 closed)

Related to TYPO3 Core - Bug #78002: Require cHash for cached plugin actions in ExtbaseClosed2016-09-20

Actions
Related to TYPO3 Core - Task #81366: Make sure all http_build_query() calls use a defined separatorClosedMarkus Klein2017-05-29

Actions
Has duplicate TYPO3 Core - Bug #81565: ID parameter needs to be passed for the cHash calculation!Closed2017-06-13

Actions
Actions

Also available in: Atom PDF