diff --git a/Classes/Service/Backend/Utility.php b/Classes/Service/Backend/Utility.php index 7f4dbb91e89a1affd222db31e6f6aac02d45ac5d..132818b70d3a96326451b94cbfd95d446b3df929 100644 --- a/Classes/Service/Backend/Utility.php +++ b/Classes/Service/Backend/Utility.php @@ -42,6 +42,7 @@ use TYPO3\CMS\Extbase\Utility\LocalizationUtility; */ class Utility { const CATEGORY_DOKTYPE = 117; + const NEWS_DOKTYPE = 117; /** * create buttons for the backend module header @@ -101,7 +102,7 @@ class Utility { } /** - * Get an array of all category titles below the given site root id + * Get an array of all category uids => >titles below the given site root id * * @param $siteRootPid * @throws \InvalidArgumentException @@ -117,11 +118,13 @@ class Utility { $databaseConnection = $GLOBALS['TYPO3_DB']; $where = 'doktype = ' . self::CATEGORY_DOKTYPE . ' AND uid in (' . $childPids . ')'; - $result = $databaseConnection->exec_SELECTquery('title', 'pages', $where)->fetch_all(); + $result = $databaseConnection->exec_SELECTquery('uid, title', 'pages', $where)->fetch_all(); $categories = []; - foreach($result as $item) { - $categories[] = $item[0]; + /** @var array $result */ + foreach ($result as $item) { + $categories[$item[0]] = $item[1]; } + return $categories; } }