Bug #34117
closedUsage of caching framework broken in TYPO3 4.5
100%
Description
Since the caching framework was heavily refactored in 4.6, this bug only happens in 4.5:
- tx_Workspaces_Service_GridData
The cache frontend was changed quite some time ago from the static string "t3lib_cache_frontend_StringFrontend" to "$GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['sys_workspace_cache']['frontend']" without adapting setDataArrayIntoCache and getDataArrayFromCache. These two functions do unserialize and serialize on the content -> all entries end up double serialized in the db when using the t3lib_cache_frontend_VariableFrontend, since this frontend automatically does that. - tx_Workspaces_Service_Tcemain
When the stage for an element is changed, this hook initializes the workspaces_cache with hardcoded t3lib_cache_frontend_StringFrontend
Combined, this leads to an error after changing the stage for an element: the tcemain hook initializes the string frontend, a new cache entry is generated, but now only serialized once. When the grid is reloaded, the double unserializing fails and no data at all is displayed in the grid.
Solution: remove the unserialize/serialize calls in tx_Workspaces_Service_GridData and replace t3lib_cache_frontend_StringFrontend with "$GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['sys_workspace_cache']['frontend']" in tx_Workspaces_Service_Tcemain
Even cleaner would probably be to move the initialization of the caching framework to a central place to get rid of the duplicate code.
Files