Bug #19843
closedDBAL 0.9.20 crashes TYPO3 4.2.x
0%
Description
When installing dbal on a 4.2.x installation of TYPO3, the backend will crash with a fatal error:
Fatal error: Call to a member function admin_get_charsets() on a non-object in /var/www/typo3-sources/typo3_src-4.2.3/t3lib/class.t3lib_install.php on line 457
Although this looks at first glance like a problem in the installer, it isn't conceptionally, I think.
It seems to fail due to a fundamental misconception. The error occurs when TYPO3 tries to set the $TYPO3_DB-object. While setting it, DBAL calls t3lib_install, which assumes that this object is already there! Without DBAL, the particular installer-method isn't even called in the first place.
Chicken and eggs, anyone? That's like using the car you are building just now to drive to the tire shop to get the tires. ;)
The real source of the error is
ux_t3lib_db->cacheFieldInfo()
238: $parsedExtSQL = $this->Installer->getFieldDefinitions_fileContent($extSQL);
This is where the installer is called although the mandatory object $TYPO3_DB is not set yet. I think dbal has to make sure the environment is set up correctly before calling core methods (which admittedly is a problem here).
If you want to trace it:
/typo3/index.php -> calls /typo3/init.php
init.php -> tries to make an instance of the db object:
167: $TYPO3_DB = t3lib_div::makeInstance('t3lib_DB');
t3lib_div detects the extension class ux_t3lib_db and tries to make an instance of that, leading to the failure in cacheFieldInfo().
(issue imported from #M10169)