Bug #66884
closedCan not use the caching Framework in bootstrap (ext_localconf/ext_tables) in specific Installtool context
0%
Description
I just merged the current master and wanted to check the table definitions.
An exception is thrown because in one extension i make use of the caching framework.
Should i avoid using the caching framework this early or is this a bug?
Files
Updated by Christian Kuhn over 9 years ago
When exactly is that thrown in install tool? Only calling the upgrade wizards or the db analyzer? Could you also please add a full backtrace?
Updated by Philipp Wrann over 9 years ago
- File screen.png screen.png added
It happens when i hit the button to for the Database analyzer.
The cachemanager is used within TCA/Overrides context.
Updated by Philipp Wrann over 9 years ago
It also happens in 6.2 LTS if you check the extensions vor compatibility. I think the problem is the Typo3DatabaseBackend. It requests the globally set TYPO3_DB object that is initilized but can not be used at this stage...
Then i set the Cache Backend as Filebackend.
If i press check extensions again an exception is thrown:
#1203699034: A cache with identifier "generatedflex" does not exist. (More information)
So i tracked it down a bit. I make use of GeneralUtility::xml2array to decode a xml structure. That Utility function makes use of the Cache itself (2nd level cache), so no matter what cache i set, i will run into this issue.
The call:
// Look up in second level cache
$array = \TYPO3\CMS\Frontend\Page\PageRepository::getHash($identifier, 0);
So i think there is no other way than bootstrapping the whole Caching Framework and Database Connection in install tool.
Updated by Jigal van Hemert over 9 years ago
Simply catching exceptions thrown by the caching framework is enough to make it work. xml2array will then work uncached, but the result of the code executed in TCA/Overrides will be cached in normal context so executing it once without the second level cache shouldn't make much of a difference.
Updated by Christian Kuhn over 9 years ago
Yes. You shouldn't use the cache framework in your ext_tables or TCA/Overrides context. Basically not much more than the casual tca helper methods and other registration or global array manipulation from core are allowed at this point. You should have as little magic as possible at this point. This also won't change anytime soon - rather the opposite: In longer run, the core will further restrict this area, so issues like that can not happen anymore. Also, keep in mind that the final TCA that falls out after these operations is fully cached, so if you have dynamic stuff in there, it wail fail anyway.
Updated by Christian Kuhn over 9 years ago
- Status changed from New to Needs Feedback
I know this is probably not the answer you want here, but the core has to do some restrictions on what can be done at this early bootstrap point to keep the whole process performant. I'll set the issue to "needs feedback" for now to wait for additional input, but would rather tend to close it as rejected sooner or later.
Updated by Philipp Wrann over 9 years ago
What i do is, that i merge flexform structures... I wrote an extension that provides some new records, all realized via single table inheritance (Superclasses/Subclasses). For each Subclass i have own plugins to display those records (typical list/results plugins). Because those flexforms share most of the settings i wrote a utility to merge flexforms, so i dont have to write the xml multiple times.
Do you suggest using a hook for this purpose or should i simply bite the bullet on this and simply write the same xml multiple times?
Updated by Benni Mack over 9 years ago
- Target version changed from 7.3 (Packages) to 7.4 (Backend)
Updated by Susanne Moog over 9 years ago
- Target version changed from 7.4 (Backend) to 7.5
Updated by Christian Kuhn almost 9 years ago
- Status changed from Needs Feedback to Rejected
if you dynamically create flex or tca structures, you're out of core support at this point and you have to handle side effects on your own.
the cache issue will not change for the reasons mentioned above. i hope it is ok if i close the issue now.