[BUGFIX] Possible warning in about module 68/17768/2
authorChristian Kuhn <lolli@schwarzbu.ch>
Mon, 28 Jan 2013 16:47:21 +0000 (17:47 +0100)
committerChristian Kuhn <lolli@schwarzbu.ch>
Mon, 28 Jan 2013 16:56:46 +0000 (17:56 +0100)
ext:about includes ext_emconf.php files of loaded extensions.
The code raises a warning if those files are not found. This
can happen for example, if some extension is loaded in
LocalConfiguration "extList", but does not exist in the file
system.

Solution is to check for file existance before include.

Change-Id: Ic58adfc908ff02d5f0d9e79b69719d02c6b429ab
Fixes: #44892
Releases: 6.1, 6.0, 4.7
Reviewed-on: https://review.typo3.org/17768
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn
typo3/sysext/about/Classes/Domain/Repository/ExtensionRepository.php

index d5adf53..85b7c7c 100644 (file)
@@ -54,13 +54,15 @@ class ExtensionRepository extends \TYPO3\CMS\Extbase\Persistence\Repository {
                foreach ($loadedExtensionsArray as $extensionKey => $extension) {
                        if (is_array($extension) && $extension['type'] != 'S') {
                                $emconfPath = PATH_site . $extension['siteRelPath'] . 'ext_emconf.php';
-                               include $emconfPath;
-                               $extension = $this->objectManager->create('TYPO3\\CMS\\About\\Domain\\Model\\Extension');
-                               $extension->setKey($extensionKey);
-                               $extension->setTitle($EM_CONF['']['title']);
-                               $extension->setAuthor($EM_CONF['']['author']);
-                               $extension->setAuthorEmail($EM_CONF['']['author_email']);
-                               $loadedExtensions->attach($extension);
+                               if (file_exists($emconfPath)) {
+                                       include $emconfPath;
+                                       $extension = $this->objectManager->create('TYPO3\\CMS\\About\\Domain\\Model\\Extension');
+                                       $extension->setKey($extensionKey);
+                                       $extension->setTitle($EM_CONF['']['title']);
+                                       $extension->setAuthor($EM_CONF['']['author']);
+                                       $extension->setAuthorEmail($EM_CONF['']['author_email']);
+                                       $loadedExtensions->attach($extension);
+                               }
                        }
                }
                return $loadedExtensions;