[+BUGFIX] Extbase (DataMapper): Fixed wrong key in $row array (credit goes to Frans...
authorJochen Rau <j.rau@web.de>
Tue, 14 Jul 2009 22:19:03 +0000 (22:19 +0000)
committerJochen Rau <j.rau@web.de>
Tue, 14 Jul 2009 22:19:03 +0000 (22:19 +0000)
typo3/sysext/extbase/Classes/Dispatcher.php
typo3/sysext/extbase/Classes/Persistence/Mapper/DataMapper.php

index 051301d..d7fd737 100644 (file)
@@ -178,7 +178,7 @@ class Tx_Extbase_Dispatcher {
                        
                        $persistenceSession = t3lib_div::makeInstance('Tx_Extbase_Persistence_Session'); // singleton
                        $storageBackend = t3lib_div::makeInstance('Tx_Extbase_Persistence_Storage_Typo3DbBackend', $GLOBALS['TYPO3_DB']); // singleton
                        
                        $persistenceSession = t3lib_div::makeInstance('Tx_Extbase_Persistence_Session'); // singleton
                        $storageBackend = t3lib_div::makeInstance('Tx_Extbase_Persistence_Storage_Typo3DbBackend', $GLOBALS['TYPO3_DB']); // singleton
-                       if (is_array($configuration) && isset($configuration['enableAutomaticCacheClearing']) && $configuration['enableAutomaticCacheClearing'] === '1') {
+                       if (isset($configuration['enableAutomaticCacheClearing']) && $configuration['enableAutomaticCacheClearing'] === '1') {
                                $storageBackend->setAutomaticCacheClearing(TRUE);
                        } else {
                                $storageBackend->setAutomaticCacheClearing(FALSE);
                                $storageBackend->setAutomaticCacheClearing(TRUE);
                        } else {
                                $storageBackend->setAutomaticCacheClearing(FALSE);
index 34e869e..e4ecca5 100644 (file)
@@ -175,7 +175,7 @@ class Tx_Extbase_Persistence_Mapper_DataMapper implements t3lib_Singleton {
                                        }
                                break;
                                case (Tx_Extbase_Persistence_PropertyType::REFERENCE):
                                        }
                                break;
                                case (Tx_Extbase_Persistence_PropertyType::REFERENCE):
-                                       if (!is_null($row[$propertyName])) {
+                                       if (!is_null($row[$columnName])) {
                                                $propertyValue = $this->mapRelatedObjects($object, $propertyName, $row, $columnMap);
                                        } else {
                                                $propertyValue = NULL;
                                                $propertyValue = $this->mapRelatedObjects($object, $propertyName, $row, $columnMap);
                                        } else {
                                                $propertyValue = NULL;
@@ -184,13 +184,13 @@ class Tx_Extbase_Persistence_Mapper_DataMapper implements t3lib_Singleton {
                                        // FIXME we have an object to handle... -> exception
                                default:
                                        // SK: We should throw an exception as this point as there was an undefined propertyType we can not handle.
                                        // FIXME we have an object to handle... -> exception
                                default:
                                        // SK: We should throw an exception as this point as there was an undefined propertyType we can not handle.
-                                       if (isset($row[$propertyName])) {
-                                               $property = $row[$propertyName];
+                                       if (isset($row[$columnName])) {
+                                               $property = $row[$columnName];
                                                if (is_object($property)) {
                                                        $propertyValue = $this->mapObject($property);
                                                        // SK: THIS case can not happen I think. At least $this->mapObject() is not available.
                                                } else {
                                                if (is_object($property)) {
                                                        $propertyValue = $this->mapObject($property);
                                                        // SK: THIS case can not happen I think. At least $this->mapObject() is not available.
                                                } else {
-                                                       // SK: This case does not make sense either. $this-mapSingleRow has a different signature 
+                                                       // SK: This case does not make sense either. $this-mapSingleRow has a different signature
                                                        $propertyValue = $this->mapSingleRow($className, $property);
                                                }
                                        }
                                                        $propertyValue = $this->mapSingleRow($className, $property);
                                                }
                                        }
@@ -305,4 +305,4 @@ class Tx_Extbase_Persistence_Mapper_DataMapper implements t3lib_Singleton {
        }
 
 }
        }
 
 }
-?>
\ No newline at end of file
+?>