[BUGFIX] Hide update icon for incompatible extensions 48/25348/3
authorNicole Cordes <typo3@cordes.co>
Tue, 12 Nov 2013 22:33:50 +0000 (23:33 +0100)
committerWouter Wolters <typo3@wouterwolters.nl>
Sat, 18 Jan 2014 10:43:37 +0000 (11:43 +0100)
Currently the update icon in extension manager is displayed every time
a higher TER version of the extension exists. But the update fails if
the TYPO3 version isn't within the extension dependencies. This patch
adds the dependency check to the isUpdateAvailable function.

Resolves: #53576
Releases: 6.2
Change-Id: I109e779037f670ab205b43cbbbb1bc16954860e6
Reviewed-on: https://review.typo3.org/25348
Reviewed-by: Philipp Gampe
Reviewed-by: Marcin S?gol
Tested-by: Marcin S?gol
Reviewed-by: Oliver Klee
Reviewed-by: Wouter Wolters
Tested-by: Wouter Wolters
typo3/sysext/extensionmanager/Classes/Utility/InstallUtility.php

index ec4504b..8c31be8 100644 (file)
@@ -378,6 +378,7 @@ class InstallUtility implements \TYPO3\CMS\Core\SingletonInterface {
         * @return boolean
         */
        public function isUpdateAvailable(\TYPO3\CMS\Extensionmanager\Domain\Model\Extension $extensionData) {
+               $isUpdateAvailable = FALSE;
                // Only check for update for TER extensions
                $version = $extensionData->getIntegerVersion();
                /** @var $highestTerVersionExtension \TYPO3\CMS\Extensionmanager\Domain\Model\Extension */
@@ -385,10 +386,14 @@ class InstallUtility implements \TYPO3\CMS\Core\SingletonInterface {
                if ($highestTerVersionExtension instanceof \TYPO3\CMS\Extensionmanager\Domain\Model\Extension) {
                        $highestVersion = $highestTerVersionExtension->getIntegerVersion();
                        if ($highestVersion > $version) {
-                               return TRUE;
+                               try {
+                                       $this->dependencyUtility->buildExtensionDependenciesTree($highestTerVersionExtension);
+                                       $isUpdateAvailable = TRUE;
+                               } catch (\TYPO3\CMS\Extensionmanager\Exception\ExtensionManagerException $e) {
+                               }
                        }
                }
-               return FALSE;
+               return $isUpdateAvailable;
        }
 
        /**