TYPO3从6.2到7.6更新仍然在TCA中出错?

时间:2017-04-07 07:34:47

标签: typo3 upgrade

我已从TYPO3 CMS 6.2更新为TYPO3 CMS 7.6.16。在其他扩展程序(tx_newsthird party ext.)以及TCA中的changes出现问题之后。导入实时转储后,一切正常......

  1. 升级向导/数据库比较
  2. 更新参考索引
  3. 刷新缓存并清空typo3temp
  4. 取消激活并重新激活有问题的扩展程序
  5. 一切吗?很不幸的是,不行。扩展程序im_appointments不起作用。我不是自己写的扩展名。如果我尝试使用此分机在后端中添加新数据记录,我将收到此错误:

    An item in field form of table tx_imappointments_domain_model_job is not an array as expected
    

    但数据库同步已完成。所有表格都正确吗?!

    typo3 database compare

    问题出在哪里?我知道很难在没有源代码的情况下对此进行分析。有一个数据库字段错误,但为什么?它和之前的数据库一样吗?

    错误在哪里.. ext_tables.php或者仍然是......在TCA中是错的?我真的需要一个小费..它令人沮丧..

    编辑: sys_log条目

    Core: Exception handler (WEB): Uncaught TYPO3 Exception: #1439288036: An item in field form of table tx_imappointments_domain_model_job is not an array as expected | UnexpectedValueException thrown in file /typo3_src/typo3_src-7.6.16/typo3/sysext/backend/Classes/Form/FormDataProvider/AbstractItemProvider.php in line 1264.
    

    编辑2:我想,必须有......在typo3conf/ext/im_appointments/Configuration/TCA/tx_imappointments_domain_model_job.phpTCA source code

    那是第1264行

    /**
     * Sanitize incoming item array
     *
     * Used by TcaSelectItems and TcaSelectTreeItems data providers
     *
     * @param mixed $itemArray
     * @param string $tableName
     * @param string $fieldName
     * @throws \UnexpectedValueException
     * @return array
     */
    public function sanitizeItemArray($itemArray, $tableName, $fieldName)
    {
        if (!is_array($itemArray)) {
            $itemArray = [];
        }
        foreach ($itemArray as $item) {
            if (!is_array($item)) {
                throw new \UnexpectedValueException(
                    'An item in field ' . $fieldName . ' of table ' . $tableName . ' is not an array as expected',
                    1439288036
                );
            }
        }
    
        return $itemArray;
    }
    

1 个答案:

答案 0 :(得分:1)

尝试在TCA中使用它tx_imappointments_domain_model_job.php

        'form' => array(
            'exclude' => 1,
            'label' => 'LLL:EXT:im_appointments/Resources/Private/Language/locallang_db.xlf:tx_imappointments_domain_model_job.form',
            'config' => array(
                'type' => 'select',
                'renderType' => 'selectSingle',
                'items' => array(array('', 0)),
                'foreign_table' => 'pages',
                'foreign_table_where' => ' AND pages.pid = 293',
                'minitems' => 0,
                'maxitems' => 1,
            ),
        ),

'项目'在'形式'必须是您的错误消息所说的数组: https://docs.typo3.org/typo3cms/TCAReference/ColumnsConfig/Type/Select.html#items