[~CONFIGURATION] Extbase: Set lockType to empty string instead of 'system'.
[Packages/TYPO3.CMS.git] / typo3 / sysext / extbase / Classes / Persistence / LazyObjectStorage.php
index 705aa85..5bf53d8 100644 (file)
@@ -113,17 +113,18 @@ class Tx_Extbase_Persistence_LazyObjectStorage extends Tx_Extbase_Persistence_Ob
        public function count() {
                $numberOfElements = NULL;
                if ($this->columnMap->getTypeOfRelation() === Tx_Extbase_Persistence_Mapper_ColumnMap::RELATION_HAS_MANY) {
-                       $this->initializeStorage();
-                       $numberOfElements = count($this->storage);
-                       // FIXME Count on comma separated lists does not respect hidden objects
-//                     if (isset($parentKeyFieldName)) {
-//                             $numberOfElements = $this->fieldValue;
-//                     } else {
-//                             if (empty($this->fieldValue)) {
-//                                     $numberOfElements = 0;
-//                             }
-//                             $numberOfElements = count(explode(',', $this->fieldValue));
-//                     }
+                       $parentKeyFieldName = $this->columnMap->getParentKeyFieldName();
+                       if (!empty($parentKeyFieldName)) {
+                               $numberOfElements = $this->fieldValue;
+                       } else {
+                               $this->initializeStorage();
+                               $numberOfElements = count($this->storage);
+                               // FIXME Count on comma separated lists does not respect hidden objects
+                               // if (empty($this->fieldValue)) {
+                               //      $numberOfElements = 0;
+                               // }
+                               // $numberOfElements = count(explode(',', $this->fieldValue));
+                       }
                } elseif ($this->columnMap->getTypeOfRelation() === Tx_Extbase_Persistence_Mapper_ColumnMap::RELATION_HAS_AND_BELONGS_TO_MANY) {
                        $numberOfElements = $this->fieldValue;                  
                } else {