Fixed bug #14129: Function tslib_cObj::getTreeList() inserts records with empty PK
authorDmitry Dulepov <dmitry.dulepov@gmail.com>
Mon, 19 Apr 2010 08:08:12 +0000 (08:08 +0000)
committerDmitry Dulepov <dmitry.dulepov@gmail.com>
Mon, 19 Apr 2010 08:08:12 +0000 (08:08 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@7386 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
typo3/sysext/cms/tslib/class.tslib_content.php

index 5499fb4..c489808 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,7 @@
 2010-04-19  Dmitry Dulepov  <dmitry.dulepov@gmail.com>
 
        * Fixed bug #14128: Tree list cache does not recognize 'this' for 'pidInList'
+       * Fixed bug #14129: Function tslib_cObj::getTreeList() inserts records with empty PK
 
 2010-04-16  Susanne Moog <typo3@susanne-moog.de>
 
index 0e6f2c4..dae41aa 100644 (file)
@@ -7462,26 +7462,27 @@ class tslib_cObj {
                                }
                                $GLOBALS['TYPO3_DB']->sql_free_result($res);
                        }
-               }
-                       // If first run, check if the ID should be returned:
-               if (!$recursionLevel) {
-                       if ($addId) {
-                               if ($begin > 0) {
-                                       $theList.= 0;
-                               } else {
-                                       $theList.= $addId;
+
+                               // If first run, check if the ID should be returned:
+                       if (!$recursionLevel) {
+                               if ($addId) {
+                                       if ($begin > 0) {
+                                               $theList.= 0;
+                                       } else {
+                                               $theList.= $addId;
+                                       }
                                }
-                       }
 
-                       $GLOBALS['TYPO3_DB']->exec_INSERTquery(
-                               'cache_treelist',
-                               array(
-                                       'md5hash'  => $requestHash,
-                                       'pid'      => $id,
-                                       'treelist' => $theList,
-                                       'tstamp'   => $GLOBALS['EXEC_TIME'],
-                               )
-                       );
+                               $GLOBALS['TYPO3_DB']->exec_INSERTquery(
+                                       'cache_treelist',
+                                       array(
+                                               'md5hash'  => $requestHash,
+                                               'pid'      => $id,
+                                               'treelist' => $theList,
+                                               'tstamp'   => $GLOBALS['EXEC_TIME'],
+                                       )
+                               );
+                       }
                }
                        // Return list:
                return $theList;