From 82e9fbead9427d289e68cedd64de9ce2b2243ce9 Mon Sep 17 00:00:00 2001
From: Christian Kuhn <lolli@schwarzbu.ch>
Date: Sun, 29 Sep 2013 20:20:52 +0200
Subject: [PATCH] [FEATURE] ext:install Show number of folder structure errors
 in menu

Similar to the environment status the number of folder structure
errors are now shown in the left menu.

Change-Id: I665c32e8a3c4389941437a2bb6caeb32b862b673
Resolves: #52368
Releases: 6.2
Reviewed-on: https://review.typo3.org/24136
Reviewed-by: Anja Leichsenring
Tested-by: Anja Leichsenring
Reviewed-by: Markus Klein
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn
---
 .../Controller/Action/AbstractAction.php      | 20 +++++++++++++------
 .../Private/Partials/Action/Common/Left.html  |  7 +++++--
 2 files changed, 19 insertions(+), 8 deletions(-)

diff --git a/typo3/sysext/install/Classes/Controller/Action/AbstractAction.php b/typo3/sysext/install/Classes/Controller/Action/AbstractAction.php
index b56ea7c313aa..85c1e4cb46a6 100644
--- a/typo3/sysext/install/Classes/Controller/Action/AbstractAction.php
+++ b/typo3/sysext/install/Classes/Controller/Action/AbstractAction.php
@@ -74,11 +74,18 @@ abstract class AbstractAction {
 	 * @return string content
 	 */
 	protected function initializeHandle() {
-			// Count of failed status checks will be displayed in the left navigation menu
-		$statusCheck = $this->objectManager->get('TYPO3\\CMS\\Install\\SystemEnvironment\\Check');
-		$statusObjects = $statusCheck->getStatus();
 		$statusUtility = $this->objectManager->get('TYPO3\\CMS\\Install\\Status\\StatusUtility');
-		$statusObjectsWithErrorStatus = $statusUtility->filterBySeverity($statusObjects, 'error');
+
+		// Count of failed environment checks are displayed in the left navigation menu
+		$environmentStatus = $this->objectManager->get('TYPO3\\CMS\\Install\\SystemEnvironment\\Check')->getStatus();
+		$environmentErrors = $statusUtility->filterBySeverity($environmentStatus, 'error');
+
+		// Count of folder structure errors are displayed in left navigation menu
+		/** @var $folderStructureFacade \TYPO3\CMS\Install\FolderStructure\StructureFacade */
+		$folderStructureFacade = $this->objectManager->get('TYPO3\\CMS\\Install\\FolderStructure\\DefaultFactory')->getStructure();
+		$folderStructureErrors = $statusUtility->filterBySeverity($folderStructureFacade->getStatus(), 'error');
+
+		// Context service distinguishes between standalone and backend context
 		$contextService = $this->objectManager->get('TYPO3\\CMS\\Install\\Service\\ContextService');
 
 		$viewRootPath = GeneralUtility::getFileAbsFileName('EXT:install/Resources/Private/');
@@ -98,7 +105,8 @@ abstract class AbstractAction {
 			->assign('messages', $this->messages)
 			->assign('typo3Version', TYPO3_version)
 			->assign('siteName', $GLOBALS['TYPO3_CONF_VARS']['SYS']['sitename'])
-			->assign('statusObjectsWithErrorStatus', $statusObjectsWithErrorStatus);
+			->assign('environmentErrors', $environmentErrors)
+			->assign('folderStructureErrors', $folderStructureErrors);
 	}
 
 	/**
@@ -229,4 +237,4 @@ abstract class AbstractAction {
 		return $saltFactory->getHashedPassword($password);
 	}
 }
-?>
+?>
\ No newline at end of file
diff --git a/typo3/sysext/install/Resources/Private/Partials/Action/Common/Left.html b/typo3/sysext/install/Resources/Private/Partials/Action/Common/Left.html
index 283bbd5d353a..6d3ab6f731d4 100644
--- a/typo3/sysext/install/Resources/Private/Partials/Action/Common/Left.html
+++ b/typo3/sysext/install/Resources/Private/Partials/Action/Common/Left.html
@@ -13,8 +13,8 @@
 		<li id="t3-install-menu-systemEnvironment" class="{f:if(condition:'{action} == \'systemEnvironment\'', then:'act')}">
 			<a href="Install.php?install[action]=systemEnvironment&install[context]={context}&install[controller]=tool">
 				System environment
-				<f:if condition="{statusObjectsWithErrorStatus}">
-					<span class="t3-install-menu-errorCount"><f:count>{statusObjectsWithErrorStatus}</f:count></span>
+				<f:if condition="{environmentErrors}">
+					<span class="t3-install-menu-errorCount"><f:count>{environmentErrors}</f:count></span>
 				</f:if>
 			</a>
 		</li>
@@ -26,6 +26,9 @@
 		<li id="t3-install-menu-folderStructure" class="{f:if(condition:'{action} == \'folderStructure\'', then:'act')}">
 			<a href="Install.php?install[action]=folderStructure&install[context]={context}&install[controller]=tool">
 				Folder structure
+				<f:if condition="{folderStructureErrors}">
+					<span class="t3-install-menu-errorCount"><f:count>{folderStructureErrors}</f:count></span>
+				</f:if>
 			</a>
 		</li>
 		<li id="t3-install-menu-testSetup" class="{f:if(condition:'{action} == \'testSetup\'', then:'act')}">
-- 
GitLab