[BUGFIX] Menus using sectionIndex is broken
authorOliver Hader <oliver@typo3.org>
Wed, 7 Dec 2011 16:10:41 +0000 (17:10 +0100)
committerOliver Hader <oliver@typo3.org>
Wed, 7 Dec 2011 16:16:12 +0000 (17:16 +0100)
Menu rendering using sectionIndex is broken
due to a wrong sql_free_result() call.

Change-Id: I8d5c1fac0705ab03a5888abfba7cf73169a9f80f
Fixes: #32375
Releases: 4.7
Reviewed-on: http://review.typo3.org/7145
Reviewed-by: Oliver Hader
Tested-by: Oliver Hader
typo3/sysext/cms/tslib/class.tslib_menu.php

index 797fead..ada109b 100644 (file)
@@ -1615,6 +1615,7 @@ class tslib_menu {
                $result = array();
                if (is_array($basePageRow)) {
                        $res = $this->parent_cObj->exec_getQuery('tt_content', $selectSetup);
+
                        while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
                                $GLOBALS['TSFE']->sys_page->versionOL('tt_content', $row);
 
@@ -1635,7 +1636,10 @@ class tslib_menu {
                                        $result[$row['uid']]['sectionIndex_uid'] = $row['uid'];
                                }
                        }
-                       $GLOBALS['TYPO3_DB']->sql_free_result();
+
+                       if (is_resource($res)) {
+                               $GLOBALS['TYPO3_DB']->sql_free_result($res);
+                       }
                }
 
                return $result;