Tinebase_Scheduler - static flag will be removed after first run
authorPaul Mehrer <p.mehrer@metaways.de>
Mon, 31 Jul 2017 15:12:41 +0000 (17:12 +0200)
committerPaul Mehrer <p.mehrer@metaways.de>
Tue, 1 Aug 2017 07:54:10 +0000 (09:54 +0200)
fixed that

Change-Id: Ifcbc2c0f97035541bcfa32e645bb4ea13e3205b4
Reviewed-on: http://gerrit.tine20.com/customers/5360
Reviewed-by: Paul Mehrer <p.mehrer@metaways.de>
Tested-by: Paul Mehrer <p.mehrer@metaways.de>
tine20/Tinebase/Scheduler/Task.php
tine20/Tinebase/Setup/Update/Release10.php
tine20/Tinebase/Setup/setup.xml

index 01bcebb..6e271d5 100644 (file)
@@ -47,7 +47,7 @@ class Tinebase_Scheduler_Task extends Zend_Scheduler_Task
         $request = new Zend_Controller_Request_Simple();
         $request->setControllerName($_requestOptions['controller']);
         $request->setActionName($_requestOptions['action']);
-        if ((isset($_requestOptions['params']) || array_key_exists('params', $_requestOptions))) {
+        if (isset($_requestOptions['params']) && is_array($_requestOptions['params'])) {
             foreach ($_requestOptions['params'] as $key => $value) {
                 $request->setParam($key, $value);
             }
@@ -485,8 +485,11 @@ class Tinebase_Scheduler_Task extends Zend_Scheduler_Task
                 if(true === $request->getUserParam('static')) {
                     $request->setParam('static', null);
                     $controller = $controllerName;
+                    $userParam = $request->getUserParams();
+                    $request->setParam('static', true);
                 } else {
                     $controller = Tinebase_Controller_Abstract::getController($controllerName);
+                    $userParam = $request->getUserParams();
                 }
             } catch (Exception $e) {
                 if (Tinebase_Core::isLogLevel(Zend_Log::WARN)) Tinebase_Core::getLogger()->warn(__METHOD__ . '::' . __LINE__
@@ -495,7 +498,7 @@ class Tinebase_Scheduler_Task extends Zend_Scheduler_Task
                 continue;
             }
 
-            $return[] = call_user_func_array(array($controller, $request->getActionName()), $request->getUserParams());
+            $return[] = call_user_func_array(array($controller, $request->getActionName()), $userParam);
         }
 
         switch(count($return)) {
index 025702d..325170a 100644 (file)
@@ -2052,4 +2052,17 @@ class Tinebase_Setup_Update_Release10 extends Setup_Update_Abstract
 
         $this->setApplicationVersion('Tinebase', '10.41');
     }
+
+    /**
+     * update to 10.42
+     *
+     * fix static scheduler issue
+     */
+    public function update_41()
+    {
+        $scheduler = Tinebase_Core::getScheduler();
+        $scheduler->removeTask('Tinebase_User/Group::syncUsers/Groups');
+        Tinebase_Scheduler_Task::addAccountSyncTask($scheduler);
+        $this->setApplicationVersion('Tinebase', '10.42');
+    }
 }
index 94f00fc..ba72f04 100644 (file)
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="utf-8"?>
 <application>
     <name>Tinebase</name>
-    <version>10.41</version>
+    <version>10.42</version>
     <tables>
         <table>
             <name>applications</name>