[BUGFIX] PHP warning in ext:documentation 93/22893/3
authorWouter Wolters <typo3@wouterwolters.nl>
Tue, 6 Aug 2013 19:18:28 +0000 (21:18 +0200)
committerStefan Neufeind <typo3.neufeind@speedpartner.de>
Tue, 6 Aug 2013 22:25:52 +0000 (00:25 +0200)
PHP warning will be thrown if typo3conf/Documentation
does not exists. Add a check to prevent the warning.

Change-Id: Ia9def8bb5b36da888eba3817ded9b348f48c37a3
Resolves: #50841
Releases: 6.2
Reviewed-on: https://review.typo3.org/22893
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn
Reviewed-by: Stefan Neufeind
Tested-by: Stefan Neufeind
typo3/sysext/documentation/Classes/Domain/Repository/DocumentRepository.php

index ae1321e..fb23062 100644 (file)
@@ -112,9 +112,14 @@ class DocumentRepository {
         */
        protected function findSphinxDocuments() {
                $basePath = 'typo3conf/Documentation/';
-               $documents = array();
 
+               $documents = array();
                $documentKeys = \TYPO3\CMS\Core\Utility\GeneralUtility::get_dirs(PATH_site . $basePath);
+               // Early return in case no document keys were found
+               if (!is_array($documentKeys)) {
+                       return $documents;
+               }
+
                foreach ($documentKeys as $documentKey) {
                        $icon = \TYPO3\CMS\Documentation\Utility\GeneralUtility::getIcon($documentKey);