0013392: Tinebase needs to be updated first
authorPhilipp Schüle <p.schuele@metaways.de>
Mon, 14 Aug 2017 11:21:29 +0000 (13:21 +0200)
committerPhilipp Schüle <p.schuele@metaways.de>
Mon, 14 Aug 2017 12:30:17 +0000 (14:30 +0200)
https://forge.tine20.org/view.php?id=13392

Change-Id: Ic434aa4ba52f91f6925596010270fee4b7dbced1
Reviewed-on: http://gerrit.tine20.com/customers/5462
Reviewed-by: Paul Mehrer <p.mehrer@metaways.de>
Tested-by: Philipp Schüle <p.schuele@metaways.de>
tine20/Setup/Controller.php

index b2db671..47959de 100644 (file)
@@ -443,18 +443,18 @@ class Setup_Controller
         $messages = array();
         
         // update tinebase first (to biggest major version)
-        $tinebase = $applications->filter('name', 'Tinebase')->getFirstRecord();
-        if (! empty($tinebase)) {
-            unset($applications[$applications->getIndexById($tinebase->getId())]);
-        
-            list($major, $minor) = explode('.', $this->getSetupXml('Tinebase')->version[0]);
-            Setup_Core::getLogger()->info(__METHOD__ . '::' . __LINE__ . ' Updating Tinebase to version ' . $major . '.' . $minor);
-            
-            for ($majorVersion = $tinebase->getMajorVersion(); $majorVersion <= $major; $majorVersion++) {
-                $messages = array_merge($messages, $this->updateApplication($tinebase, $majorVersion));
-            }
+        $tinebase = Tinebase_Application::getInstance()->getApplicationByName('Tinebase');
+        if ($idx = $applications->getIndexById($tinebase->getId())) {
+            unset($applications[$idx]);
         }
-            
+
+        list($major, $minor) = explode('.', $this->getSetupXml('Tinebase')->version[0]);
+        Setup_Core::getLogger()->info(__METHOD__ . '::' . __LINE__ . ' Updating Tinebase to version ' . $major . '.' . $minor);
+
+        for ($majorVersion = $tinebase->getMajorVersion(); $majorVersion <= $major; $majorVersion++) {
+            $messages = array_merge($messages, $this->updateApplication($tinebase, $majorVersion));
+        }
+
         // update the rest
         for ($majorVersion = $smallestMajorVersion; $majorVersion <= $biggestMajorVersion; $majorVersion++) {
             foreach ($applications as $application) {