[BUGFIX] EM installs outdated versions of depending extensions
authorSteffen Gebert <steffen.gebert@typo3.org>
Wed, 5 Oct 2011 20:11:13 +0000 (22:11 +0200)
committerXavier Perseguers <xavier@typo3.org>
Thu, 6 Oct 2011 13:52:12 +0000 (15:52 +0200)
When installing an extension with a dependency to another extension,
which is not available on the server, EM retrieves it from TER. However,
by mistake it always retrieves the oldest version, not the newest.

Change-Id: I518cd5e4521d5ad1b578e342175f8b542ef42d02
Resolves: #29243
Releases: 4.6, 4.5
Reviewed-on: http://review.typo3.org/5574
Reviewed-by: Josef Florian Glatz
Tested-by: Josef Florian Glatz
Reviewed-by: Xavier Perseguers
Tested-by: Xavier Perseguers
typo3/sysext/em/classes/index.php

index f796ae5..bd11b5d 100644 (file)
@@ -1459,6 +1459,8 @@ class SC_mod_tools_em_index extends t3lib_SCbase {
                        // Fetch extension from TER:
                        if (!strlen($version)) {
                                $versions = array_keys($this->xmlHandler->extensionsXML[$extKey]['versions']);
+                                       // sort version numbers ascending to pick the highest version
+                               natsort($versions);
                                $version = end($versions);
                        }
                        $fetchData = $this->terConnection->fetchExtension($extKey, $version, $this->xmlHandler->extensionsXML[$extKey]['versions'][$version]['t3xfilemd5'], $this->getMirrorURL());