make sure setupuser is present when installing new apps
authorPhilipp Schüle <p.schuele@metaways.de>
Wed, 14 Jun 2017 14:10:03 +0000 (16:10 +0200)
committerPhilipp Schüle <p.schuele@metaways.de>
Thu, 15 Jun 2017 09:55:45 +0000 (11:55 +0200)
Change-Id: If59d720020606380e1946440d1871e648c0a778a
Reviewed-on: http://gerrit.tine20.com/customers/4876
Tested-by: Jenkins CI (http://ci.tine20.com/)
Reviewed-by: Philipp Schüle <p.schuele@metaways.de>
tine20/Setup/Controller.php

index 4ec5332..1eb1198 100644 (file)
@@ -1400,6 +1400,11 @@ class Setup_Controller
                     $_applications[] = $requiredApp;
                 }
             }
+        } else {
+            $setupUser = Setup_Update_Abstract::getSetupFromConfigOrCreateOnTheFly();
+            if ($setupUser && ! Tinebase_Core::getUser() instanceof Tinebase_Model_User) {
+                Tinebase_Core::set(Tinebase_Core::USER, $setupUser);
+            }
         }
         
         // get xml and sort apps first
@@ -1451,7 +1456,7 @@ class Setup_Controller
         $this->restore($options);
 
         $setupUser = Setup_Update_Abstract::getSetupFromConfigOrCreateOnTheFly();
-        if (! Tinebase_Core::getUser() instanceof Tinebase_Model_User) {
+        if ($setupUser && ! Tinebase_Core::getUser() instanceof Tinebase_Model_User) {
             Tinebase_Core::set(Tinebase_Core::USER, $setupUser);
         }