[+BUGFIX] Fluid (Widget): Adopt Widget Bootstrap to Extbase Bootstrap changes
authorSebastian Kurfürst <sebastian@typo3.org>
Fri, 21 Jan 2011 12:41:39 +0000 (12:41 +0000)
committerSebastian Kurfürst <sebastian@typo3.org>
Fri, 21 Jan 2011 12:41:39 +0000 (12:41 +0000)
Problem: The configureObjectManager method in Tx_Fluid_Core_Widget_Bootstrap
uses a call on a static method Tx_Extbase_Object_Container_Container::getContainer()
which doesn't exist anymore. The Container has become a t3lib_Singleton.

This patch changes the behavior, and makes it work again.

Thanks to Thomas Maroschik for the patch!

Resolves: #11991

typo3/sysext/fluid/Classes/Core/Widget/Bootstrap.php

index 213c4f2..3d85f27 100644 (file)
@@ -100,14 +100,14 @@ class Tx_Fluid_Core_Widget_Bootstrap {
         */
        public function configureObjectManager() {
                $typoScriptSetup = $this->configurationManager->getConfiguration(Tx_Extbase_Configuration_ConfigurationManagerInterface::CONFIGURATION_TYPE_FULL_TYPOSCRIPT);
-               if (isset($typoScriptSetup['config.']['tx_extbase.']['objects.']) && is_array($typoScriptSetup['config.']['tx_extbase.']['objects.'])) {
-                       $objectConfiguration = $typoScriptSetup['config.']['tx_extbase.']['objects.'];
-
-                       foreach ($objectConfiguration as $classNameWithDot => $classConfiguration) {
-                               if (isset($classConfiguration['className'])) {
-                                       $originalClassName = substr($classNameWithDot, 0, -1);
-                                       Tx_Extbase_Object_Container_Container::getContainer()->registerImplementation($originalClassName, $classConfiguration['className']);
-                               }
+               if (!is_array($typoScriptSetup['config.']['tx_extbase.']['objects.'])) {
+                       return;
+               }
+               $objectContainer = t3lib_div::makeInstance('Tx_Extbase_Object_Container_Container');
+               foreach ($typoScriptSetup['config.']['tx_extbase.']['objects.'] as $classNameWithDot => $classConfiguration) {
+                       if (isset($classConfiguration['className'])) {
+                               $originalClassName = rtrim($classNameWithDot, '.');
+                               $objectContainer->registerImplementation($originalClassName, $classConfiguration['className']);
                        }
                }
        }