Index: examples/class.tx_scheduler_sleeptask_hook.php =================================================================== --- examples/class.tx_scheduler_sleeptask_hook.php (revision 1045) +++ examples/class.tx_scheduler_sleeptask_hook.php (working copy) @@ -53,15 +53,17 @@ */ public function getAdditionalFields(&$taskInfo, $task, tx_scheduler_module1 $parentObject) { - if ($parentObject->CMD == 'add' && empty($taskInfo['sleepTime'])) { - // In case of new task and if field is empty, set default sleep time - $taskInfo['sleepTime'] = 30; - } else if ($parentObject->CMD == 'edit' && $task instanceof self::$class && empty($taskInfo['sleepTime'])) { - // In case of edit, and editing a test task, set to internal value if not data was submitted already - $taskInfo['sleepTime'] = $task->sleepTime; - } else { - // Otherwise set an empty value, as it will not be used anyway - $taskInfo['sleepTime'] = ''; + if (empty($taskInfo['sleepTime'])) { + if ($parentObject->CMD == 'add') { + // In case of new task and if field is empty, set default sleep time + $taskInfo['sleepTime'] = 30; + } else if ($parentObject->CMD == 'edit' && $task instanceof self::$class) { + // In case of edit, and editing a test task, set to internal value if not data was submitted already + $taskInfo['sleepTime'] = $task->sleepTime; + } else { + // Otherwise set an empty value, as it will not be used anyway + $taskInfo['sleepTime'] = ''; + } } // Write the code for the field Index: examples/class.tx_scheduler_testtask_hook.php =================================================================== --- examples/class.tx_scheduler_testtask_hook.php (revision 1045) +++ examples/class.tx_scheduler_testtask_hook.php (working copy) @@ -52,17 +52,18 @@ * For each field it provides an associative sub-array with the following: */ public function getAdditionalFields(&$taskInfo, $task, tx_scheduler_module1 $parentObject) { + if (empty($taskInfo['email'])) { + if ($parentObject->CMD == 'add') { + // In case of new task and if field is empty, set default email address + $taskInfo['email'] = $GLOBALS['BE_USER']->user['email']; - if ($parentObject->CMD == 'add' && empty($taskInfo['email'])) { - // In case of new task and if field is empty, set default email address - $taskInfo['email'] = $GLOBALS['BE_USER']->user['email']; - - } elseif ($parentObject->CMD == 'edit' && $task instanceof self::$class && empty($taskInfo['email'])) { - // In case of edit, and editing a test task, set to internal value if not data was submitted already - $taskInfo['email'] = $task->email; - } else { - // Otherwise set an empty value, as it will not be used anyway - $taskInfo['email'] = ''; + } elseif ($parentObject->CMD == 'edit' && $task instanceof self::$class) { + // In case of edit, and editing a test task, set to internal value if not data was submitted already + $taskInfo['email'] = $task->email; + } else { + // Otherwise set an empty value, as it will not be used anyway + $taskInfo['email'] = ''; + } } // Write the code for the field