Project

General

Profile

Actions

Bug #65708

closed

ReflectionService updates unchanged data

Added by Leendert van Beelen about 9 years ago. Updated over 6 years ago.

Status:
Closed
Priority:
Must have
Assignee:
-
Category:
Extbase
Target version:
-
Start date:
2015-03-12
Due date:
% Done:

0%

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

Description

The extbase ReflectionService is not protected against use before initialization. When it is used before being initialized the dataCacheNeedsUpdate flag is set, which results in a database update when shutdown method is called.

To reproduce the problem,
1) create a page with the following typoscript setup:

lib.content = CONTENT
lib.content {
    table = tt_content
     select.where = colPos=0
}

page = PAGE
page {
    10 = FLUIDTEMPLATE
    10 {
        file = site/Templates/index.html
    }
}

2) The file site/Templates/index.html should contain this html: <f:cObject typoscriptObjectPath="lib.content"/>
3) Place an extbase plugin on the page in the column with colPos 0 (usually the main content)

What happens when rendering this page is that the fluid viewhelper uses the ReflectionService without initialization and dataCacheNeedsUpdate is set to TRUE. Next the extbase plugin is instantiated and initialize method is called, that loads the data from the cache. When the extbase plugin is done it calls the shutdown method of the ReflectionService, which is going to call $this->saveToCache(); because the viewhelper set the dataCacheNeedsUpdate flag before.

I think the ReflectionService shouldn't be a singleton, because it's initialized for a specific extension it should have an object for each extension.


Files

Actions

Also available in: Atom PDF