[BUGFIX] DataDictionary is not always properly instantiated
authorXavier Perseguers <typo3@perseguers.ch>
Tue, 8 Mar 2011 16:49:50 +0000 (17:49 +0100)
committerXavier Perseguers <typo3@perseguers.ch>
Tue, 8 Mar 2011 17:06:45 +0000 (18:06 +0100)
Many operations in TYPO3 backend lead to a fatal error: Call to a member function NameQuote() on a non-object.
This is due to an improper instantiation of a DataDictionary.

Change-Id: I43dc23be9045073a695ee244f5fd3a0c37247d4b
Resolves: #13691

typo3/sysext/dbal/class.ux_t3lib_db.php

index 24148b6..d02da5b 100644 (file)
@@ -1980,6 +1980,10 @@ class ux_t3lib_DB extends t3lib_DB {
                $handlerKey = $handlerKey ? $handlerKey : $this->lastHandlerKey;
                $useNameQuote = isset($this->handlerCfg[$handlerKey]['config']['useNameQuote']) ? $this->handlerCfg[$handlerKey]['config']['useNameQuote'] : FALSE;
                if ($useNameQuote) {
+                       // Sometimes DataDictionary is not properly instantiated
+                       if (!is_object($this->handlerInstance[$handlerKey]->DataDictionary)) {
+                               $this->handlerInstance[$handlerKey]->DataDictionary = NewDataDictionary($this->handlerInstance[$handlerKey]);
+                       }
                        return $this->handlerInstance[$handlerKey]->DataDictionary->NameQuote($name);
                } else {
                        $quote = $useBackticks ? '`' : $this->handlerInstance[$handlerKey]->nameQuote;