From 47e63fc33c7dd45111465d833216eb474f224b9e Mon Sep 17 00:00:00 2001
From: Michael Binder <binder-michael@gmx.net>
Date: Tue, 3 Dec 2019 13:39:08 +0100
Subject: [PATCH] [BUGFIX] Use existing API instead of ContentObjectRenderer

This Patch allows the usage of an HMENU with special = directory and
the Fallback Type 'Free mode'

Resolves: #88344
Related: #89368
Releases: master, 9.5
Change-Id: Ib7f53b4e061b6387e6b29b2545696a3eb2d015a0
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/62527
Tested-by: TYPO3com <noreply@typo3.com>
Tested-by: Tobias Gaertner <tobias.gaertner@benaja-websolutions.com>
Tested-by: Benni Mack <benni@typo3.org>
Reviewed-by: Guido Schmechel <guido.schmechel@brandung.de>
Reviewed-by: Tobias Gaertner <tobias.gaertner@benaja-websolutions.com>
Reviewed-by: Benni Mack <benni@typo3.org>
---
 .../Classes/ContentObject/Menu/AbstractMenuContentObject.php  | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/typo3/sysext/frontend/Classes/ContentObject/Menu/AbstractMenuContentObject.php b/typo3/sysext/frontend/Classes/ContentObject/Menu/AbstractMenuContentObject.php
index 1c5b7fefbdca..b2184c8dfe18 100644
--- a/typo3/sysext/frontend/Classes/ContentObject/Menu/AbstractMenuContentObject.php
+++ b/typo3/sysext/frontend/Classes/ContentObject/Menu/AbstractMenuContentObject.php
@@ -675,8 +675,8 @@ abstract class AbstractMenuContentObject
                 $id = $mount_info['mount_pid'];
             }
             // Get sub-pages:
-            $statement = $this->parent_cObj->exec_getQuery('pages', ['pidInList' => $id, 'orderBy' => $sortingField]);
-            while ($row = $statement->fetch()) {
+            $rows = $this->sys_page->getMenu($id, '*', $sortingField);
+            foreach ($rows as $row) {
                 $tsfe->sys_page->versionOL('pages', $row, true);
                 if (!empty($row)) {
                     // Keep mount point?
-- 
GitLab