Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/typo3/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Typo3 AdditionalFieldsProvider不保存配置_Typo3_Scheduler - Fatal编程技术网

Typo3 AdditionalFieldsProvider不保存配置

Typo3 AdditionalFieldsProvider不保存配置,typo3,scheduler,Typo3,Scheduler,我的计划程序任务获得一个附加字段。选择此selectfield中的选项工作正常,任务将相应执行。但是,如果我打开任务进行配置,则不会显示原始配置,它始终会在我的选择字段中显示第一个选项 这是我的班级: class AdditionalFieldProviderSocialHubImporter implements \TYPO3\CMS\Scheduler\AdditionalFieldProviderInterface { /** * This method is used to defin

我的计划程序任务获得一个附加字段。选择此selectfield中的选项工作正常,任务将相应执行。但是,如果我打开任务进行配置,则不会显示原始配置,它始终会在我的选择字段中显示第一个选项

这是我的班级:

class AdditionalFieldProviderSocialHubImporter implements \TYPO3\CMS\Scheduler\AdditionalFieldProviderInterface {
/**
 * This method is used to define new fields for adding or editing a task
 * In this case, it adds an email field
 *
 * @param array $taskInfo Reference to the array containing the info used in the add/edit form
 * @param object $task When editing, reference to the current task object. Null when adding.
 * @param \TYPO3\CMS\Scheduler\Controller\SchedulerModuleController $parentObject Reference to the calling object (Scheduler's BE module)
 * @return array Array containing all the information pertaining to the additional fields
 */
public function getAdditionalFields(array &$taskInfo, $task, \TYPO3\CMS\Scheduler\Controller\SchedulerModuleController $parentObject) {
    $additionalFields = array();
    if (empty($taskInfo['replaceVideoStreams']) || $taskInfo['replaceVideoStreams'] === 'false') {
        $taskInfo['replaceVideoStreams'] = 'false';
        $optionTrue = '';
        $optionFalse = 'selected';
    } else {
        $optionTrue = 'selected';
        $optionFalse = '';
    }
    // Write the code for the field
    $fieldID = 'task_replaceVideoStreams';

    $fieldCode = '<select name="tx_scheduler[replaceVideoStreams]" id="' . $fieldID . '">
      <option value="false" '.$optionFalse.'>false</option>
      <option value="true" '.$optionTrue.'>true</option>
    </select>';

    $additionalFields[$fieldID] = array(
        'code' => $fieldCode,
        'label' => 'LLL:EXT:exutectmaps/Resources/Private/Language/locallang.xlf:tx_exutecmaps_domain_model_feeds.replaceVideoStreams',
        'cshKey' => '_MOD_system_txschedulerM1',
        'cshLabel' => $fieldID
    );
    return $additionalFields;
}
/**
 * This method checks any additional data that is relevant to the specific task
 * If the task class is not relevant, the method is expected to return TRUE
 *
 * @param array $submittedData Reference to the array containing the data submitted by the user
 * @param \TYPO3\CMS\Scheduler\Controller\SchedulerModuleController $parentObject Reference to the calling object (Scheduler's BE module)
 * @return boolean TRUE if validation was ok (or selected class is not relevant), FALSE otherwise
 */
public function validateAdditionalFields(array &$submittedData, \TYPO3\CMS\Scheduler\Controller\SchedulerModuleController $parentObject) {
    return TRUE;
}
/**
 * This method is used to save any additional input into the current task object
 * if the task class matches
 *
 * @param array $submittedData Array containing the data submitted by the user
 * @param \TYPO3\CMS\Scheduler\Task\AbstractTask $task Reference to the current task object
 * @return void
 */
public function saveAdditionalFields(array $submittedData, \TYPO3\CMS\Scheduler\Task\AbstractTask $task) {
    $task->replaceVideoStreams = $submittedData['replaceVideoStreams'];
}
}
class AdditionalFieldProviderSocialHubImporter实现\TYPO3\CMS\Scheduler\AdditionalFieldProviderInterface{
/**
*此方法用于定义用于添加或编辑任务的新字段
*在本例中,它添加了一个电子邮件字段
*
*@param array$taskInfo对包含添加/编辑表单中使用的信息的数组的引用
*@param object$task编辑时,引用当前任务对象。添加时为空。
*@param\TYPO3\CMS\Scheduler\Controller\SchedulerModuleController$parentObject对调用对象(调度器的BE模块)的引用
*@return数组包含与附加字段相关的所有信息
*/
公共函数getAdditionalFields(数组和$taskInfo,$task,\TYPO3\CMS\Scheduler\Controller\SchedulerModuleController$parentObject){
$additionalFields=array();
if(空($taskInfo['replaceVideoStreams'])| |$taskInfo['replaceVideoStreams']='false'){
$taskInfo['replaceVideoStreams']='false';
$optionrue='';
$optionFalse='selected';
}否则{
$optionrue='selected';
$optionFalse='';
}
//为字段编写代码
$fieldID='task_replaceVideoStreams';
$fieldCode=
假的
真的
';
$additionalFields[$fieldID]=数组(
“代码”=>$fieldCode,
'label'=>'LLL:EXT:exutecmap/Resources/Private/Language/locallang.xlf:tx\u exutecmap\u domain\u model\u feed.replaceVideoStreams',
“cshKey'=>”\u MOD_system\u txschedulerM1',
“cshLabel”=>$fieldID
);
返回$additionalFields;
}
/**
*此方法检查与特定任务相关的任何其他数据
*如果任务类不相关,则该方法应返回TRUE
*
*@param array$submittedData对包含用户提交的数据的数组的引用
*@param\TYPO3\CMS\Scheduler\Controller\SchedulerModuleController$parentObject对调用对象(调度器的BE模块)的引用
*@如果验证正常(或所选类不相关),则返回布尔值TRUE,否则返回FALSE
*/
公共函数validateAdditionalFields(数组和$submittedData,\TYPO3\CMS\Scheduler\Controller\SchedulerModuleController$parentObject){
返回TRUE;
}
/**
*此方法用于将任何其他输入保存到当前任务对象中
*如果任务类匹配
*
*@param array$submittedData数组包含用户提交的数据
*@param\TYPO3\CMS\Scheduler\Task\AbstractTask$Task对当前任务对象的引用
*@返回无效
*/
公共函数saveAdditionalFields(数组$submittedData,\TYPO3\CMS\Scheduler\Task\AbstractTask$Task){
$task->replaceVideoStreams=$submittedData['replaceVideoStreams'];
}
}

getAdditionalFields()
方法的开头添加如下内容-
$taskInfo
仅包含客户端提交的值,如果添加或编辑任务,必须首先初始化这些值

// assign default value
if (!isset($taskInfo['replaceVideoStreams'])) {
    $taskInfo['replaceVideoStreams'] = 'false';
    // assign value of task currently being edited
    if ($parentObject->CMD === 'edit') {
        $taskInfo['replaceVideoStreams'] = $task->replaceVideoStreams;
    }
}

的代码类似于此,另外还涉及
add
命令。

getAdditionalFields()
方法的开头添加类似以下内容-
$taskInfo
仅包含在客户端提交的值,如果添加或编辑任务,必须首先初始化这些值

// assign default value
if (!isset($taskInfo['replaceVideoStreams'])) {
    $taskInfo['replaceVideoStreams'] = 'false';
    // assign value of task currently being edited
    if ($parentObject->CMD === 'edit') {
        $taskInfo['replaceVideoStreams'] = $task->replaceVideoStreams;
    }
}
的代码与之类似,另外还涉及
add
命令