dougong5817 2017-03-28 12:05
浏览 47
已采纳

使用兼容性6在TYPO3 7.6中爆炸错误

I've got errors after update from TYPO3 6.2 to typo3 7.6 with compatibility6 mode enabled.

In the backend, when I need to edit page or article, the content is not charged in the textareas and I've got this warning

PHP Warning
Core: Error handler (BE): PHP Warning: explode() expects parameter 2 to be string, array given in /home/typo3/typo3_src-7.6.16/typo3/sysext/core/Classes/Utility/GeneralUtility.php line 1556

To try to debug it, i put a test in the trimExplode function of typo3 like this:

if(is_array($string)){
    $e = new \Exception();
    $error_string = $e->getTraceAsString();
    $f = fopen('/var/www/html/custom.log', 'a+');
    fputs($f, PHP_EOL . "new line" . PHP_EOL);
    fputs($f, PHP_EOL . $error_string . PHP_EOL);
    fputs($f, PHP_EOL . print_r($string) . PHP_EOL);
    fclose($f);
}

But the stacktrace that i get is not enough clear for me to understand what's wrong. The array is empty and so, i think the problem is not the array, but is in compatibility6. Does anybody know what's the problem with compatibility6? Here's the stacktrace

new line
#0 /home/typo3/typo3_src-7.6.16/typo3/sysext/backend/Classes/Form/FormDataProvider/AbstractItemProvider.php(1142): TYPO3\CMS\Core\Utility\GeneralUtility::trimExplode(',', Array, true)
#1 /home/typo3/typo3_src-7.6.16/typo3/sysext/backend/Classes/Form/FormDataProvider/TcaSelectItems.php(75): TYPO3\CMS\Backend\Form\FormDataProvider\AbstractItemProvider->processDatabaseFieldValue(Array, 'field_auto_head...')
#2 /home/typo3/typo3_src-7.6.16/typo3/sysext/backend/Classes/Form/FormDataGroup/FlexFormSegment.php(51): TYPO3\CMS\Backend\Form\FormDataProvider\TcaSelectItems->addData(Array)
#3 /home/typo3/typo3_src-7.6.16/typo3/sysext/backend/Classes/Form/FormDataCompiler.php(99): TYPO3\CMS\Backend\Form\FormDataGroup\FlexFormSegment->compile(Array)
#4 /var/www/html/typo3conf/ext/compatibility6/Classes/Form/FormDataProvider/TcaFlexProcess.php(549): TYPO3\CMS\Backend\Form\FormDataCompiler->compile(Array)
#5 /var/www/html/typo3conf/ext/compatibility6/Classes/Form/FormDataProvider/TcaFlexProcess.php(54): TYPO3\CMS\Compatibility6\Form\FormDataProvider\TcaFlexProcess->modifyDataStructureAndDataValuesByFlexFormSegmentGroup(Array, 'tx_templavoila_...', Array)
#6 /home/typo3/typo3_src-7.6.16/typo3/sysext/backend/Classes/Form/FormDataGroup/TcaDatabaseRecord.php(51): TYPO3\CMS\Compatibility6\Form\FormDataProvider\TcaFlexProcess->addData(Array)
#7 /home/typo3/typo3_src-7.6.16/typo3/sysext/backend/Classes/Form/FormDataCompiler.php(99): TYPO3\CMS\Backend\Form\FormDataGroup\TcaDatabaseRecord->compile(Array)
#8 /home/typo3/typo3_src-7.6.16/typo3/sysext/backend/Classes/Controller/EditDocumentController.php(1118): TYPO3\CMS\Backend\Form\FormDataCompiler->compile(Array)
#9 /home/typo3/typo3_src-7.6.16/typo3/sysext/backend/Classes/Controller/EditDocumentController.php(1009): TYPO3\CMS\Backend\Controller\EditDocumentController->makeEditForm()
#10 /home/typo3/typo3_src-7.6.16/typo3/sysext/backend/Classes/Controller/EditDocumentController.php(2043): TYPO3\CMS\Backend\Controller\EditDocumentController->main()
#11 [internal function]: TYPO3\CMS\Backend\Controller\EditDocumentController->mainAction(Object(TYPO3\CMS\Core\Http\ServerRequest), Object(TYPO3\CMS\Core\Http\Response))
#12 /home/typo3/typo3_src-7.6.16/typo3/sysext/backend/Classes/Http/RouteDispatcher.php(54): call_user_func_array(Array, Array)
#13 /home/typo3/typo3_src-7.6.16/typo3/sysext/backend/Classes/Http/RequestHandler.php(168): TYPO3\CMS\Backend\Http\RouteDispatcher->dispatch(Object(TYPO3\CMS\Core\Http\ServerRequest), Object(TYPO3\CMS\Core\Http\Response))
#14 /home/typo3/typo3_src-7.6.16/typo3/sysext/backend/Classes/Http/RequestHandler.php(95): TYPO3\CMS\Backend\Http\RequestHandler->dispatch(Object(TYPO3\CMS\Core\Http\ServerRequest))
#15 /home/typo3/typo3_src-7.6.16/typo3/sysext/core/Classes/Core/Bootstrap.php(302): TYPO3\CMS\Backend\Http\RequestHandler->handleRequest(Object(TYPO3\CMS\Core\Http\ServerRequest))
#16 /home/typo3/typo3_src-7.6.16/typo3/sysext/backend/Classes/Http/Application.php(94): TYPO3\CMS\Core\Core\Bootstrap->handleRequest(Object(TYPO3\CMS\Core\Http\ServerRequest))
#17 /home/typo3/typo3_src-7.6.16/typo3/index.php(20): TYPO3\CMS\Backend\Http\Application->run()
#18 [internal function]: {closure}()
#19 /home/typo3/typo3_src-7.6.16/typo3/index.php(21): call_user_func(Object(Closure))
#20 {main}

1

new line

#0 /home/typo3/typo3_src-7.6.16/typo3/sysext/backend/Classes/Form/FormDataProvider/AbstractItemProvider.php(1142): TYPO3\CMS\Core\Utility\GeneralUtility::trimExplode(',', Array, true)
#1 /home/typo3/typo3_src-7.6.16/typo3/sysext/backend/Classes/Form/FormDataProvider/TcaSelectItems.php(75): TYPO3\CMS\Backend\Form\FormDataProvider\AbstractItemProvider->processDatabaseFieldValue(Array, 'field_feature_b...')
#2 /home/typo3/typo3_src-7.6.16/typo3/sysext/backend/Classes/Form/FormDataGroup/FlexFormSegment.php(51): TYPO3\CMS\Backend\Form\FormDataProvider\TcaSelectItems->addData(Array)
#3 /home/typo3/typo3_src-7.6.16/typo3/sysext/backend/Classes/Form/FormDataCompiler.php(99): TYPO3\CMS\Backend\Form\FormDataGroup\FlexFormSegment->compile(Array)
#4 /var/www/html/typo3conf/ext/compatibility6/Classes/Form/FormDataProvider/TcaFlexProcess.php(549): TYPO3\CMS\Backend\Form\FormDataCompiler->compile(Array)
#5 /var/www/html/typo3conf/ext/compatibility6/Classes/Form/FormDataProvider/TcaFlexProcess.php(54): TYPO3\CMS\Compatibility6\Form\FormDataProvider\TcaFlexProcess->modifyDataStructureAndDataValuesByFlexFormSegmentGroup(Array, 'tx_templavoila_...', Array)
#6 /home/typo3/typo3_src-7.6.16/typo3/sysext/backend/Classes/Form/FormDataGroup/TcaDatabaseRecord.php(51): TYPO3\CMS\Compatibility6\Form\FormDataProvider\TcaFlexProcess->addData(Array)
#7 /home/typo3/typo3_src-7.6.16/typo3/sysext/backend/Classes/Form/FormDataCompiler.php(99): TYPO3\CMS\Backend\Form\FormDataGroup\TcaDatabaseRecord->compile(Array)
#8 /home/typo3/typo3_src-7.6.16/typo3/sysext/backend/Classes/Controller/EditDocumentController.php(1118): TYPO3\CMS\Backend\Form\FormDataCompiler->compile(Array)
#9 /home/typo3/typo3_src-7.6.16/typo3/sysext/backend/Classes/Controller/EditDocumentController.php(1009): TYPO3\CMS\Backend\Controller\EditDocumentController->makeEditForm()
#10 /home/typo3/typo3_src-7.6.16/typo3/sysext/backend/Classes/Controller/EditDocumentController.php(2043): TYPO3\CMS\Backend\Controller\EditDocumentController->main()
#11 [internal function]: TYPO3\CMS\Backend\Controller\EditDocumentController->mainAction(Object(TYPO3\CMS\Core\Http\ServerRequest), Object(TYPO3\CMS\Core\Http\Response))
#12 /home/typo3/typo3_src-7.6.16/typo3/sysext/backend/Classes/Http/RouteDispatcher.php(54): call_user_func_array(Array, Array)
#13 /home/typo3/typo3_src-7.6.16/typo3/sysext/backend/Classes/Http/RequestHandler.php(168): TYPO3\CMS\Backend\Http\RouteDispatcher->dispatch(Object(TYPO3\CMS\Core\Http\ServerRequest), Object(TYPO3\CMS\Core\Http\Response))
#14 /home/typo3/typo3_src-7.6.16/typo3/sysext/backend/Classes/Http/RequestHandler.php(95): TYPO3\CMS\Backend\Http\RequestHandler->dispatch(Object(TYPO3\CMS\Core\Http\ServerRequest))
#15 /home/typo3/typo3_src-7.6.16/typo3/sysext/core/Classes/Core/Bootstrap.php(302): TYPO3\CMS\Backend\Http\RequestHandler->handleRequest(Object(TYPO3\CMS\Core\Http\ServerRequest))
#16 /home/typo3/typo3_src-7.6.16/typo3/sysext/backend/Classes/Http/Application.php(94): TYPO3\CMS\Core\Core\Bootstrap->handleRequest(Object(TYPO3\CMS\Core\Http\ServerRequest))
#17 /home/typo3/typo3_src-7.6.16/typo3/index.php(20): TYPO3\CMS\Backend\Http\Application->run()
#18 [internal function]: {closure}()
#19 /home/typo3/typo3_src-7.6.16/typo3/index.php(21): call_user_func(Object(Closure))
#20 {main}

1

new line

#0 /home/typo3/typo3_src-7.6.16/typo3/sysext/backend/Classes/Form/FormDataProvider/AbstractItemProvider.php(1142): TYPO3\CMS\Core\Utility\GeneralUtility::trimExplode(',', Array, true)
#1 /home/typo3/typo3_src-7.6.16/typo3/sysext/backend/Classes/Form/FormDataProvider/TcaSelectItems.php(75): TYPO3\CMS\Backend\Form\FormDataProvider\AbstractItemProvider->processDatabaseFieldValue(Array, 'recursive')
#2 /home/typo3/typo3_src-7.6.16/typo3/sysext/backend/Classes/Form/FormDataGroup/FlexFormSegment.php(51): TYPO3\CMS\Backend\Form\FormDataProvider\TcaSelectItems->addData(Array)
#3 /home/typo3/typo3_src-7.6.16/typo3/sysext/backend/Classes/Form/FormDataCompiler.php(99): TYPO3\CMS\Backend\Form\FormDataGroup\FlexFormSegment->compile(Array)
#4 /var/www/html/typo3conf/ext/compatibility6/Classes/Form/FormDataProvider/TcaFlexProcess.php(549): TYPO3\CMS\Backend\Form\FormDataCompiler->compile(Array)
#5 /var/www/html/typo3conf/ext/compatibility6/Classes/Form/FormDataProvider/TcaFlexProcess.php(54): TYPO3\CMS\Compatibility6\Form\FormDataProvider\TcaFlexProcess->modifyDataStructureAndDataValuesByFlexFormSegmentGroup(Array, 'pi_flexform', Array)
#6 /home/typo3/typo3_src-7.6.16/typo3/sysext/backend/Classes/Form/FormDataGroup/TcaDatabaseRecord.php(51): TYPO3\CMS\Compatibility6\Form\FormDataProvider\TcaFlexProcess->addData(Array)
#7 /home/typo3/typo3_src-7.6.16/typo3/sysext/backend/Classes/Form/FormDataCompiler.php(99): TYPO3\CMS\Backend\Form\FormDataGroup\TcaDatabaseRecord->compile(Array)
#8 /home/typo3/typo3_src-7.6.16/typo3/sysext/backend/Classes/Controller/EditDocumentController.php(1118): TYPO3\CMS\Backend\Form\FormDataCompiler->compile(Array)
#9 /home/typo3/typo3_src-7.6.16/typo3/sysext/backend/Classes/Controller/EditDocumentController.php(1009): TYPO3\CMS\Backend\Controller\EditDocumentController->makeEditForm()
#10 /home/typo3/typo3_src-7.6.16/typo3/sysext/backend/Classes/Controller/EditDocumentController.php(2043): TYPO3\CMS\Backend\Controller\EditDocumentController->main()
#11 [internal function]: TYPO3\CMS\Backend\Controller\EditDocumentController->mainAction(Object(TYPO3\CMS\Core\Http\ServerRequest), Object(TYPO3\CMS\Core\Http\Response))
#12 /home/typo3/typo3_src-7.6.16/typo3/sysext/backend/Classes/Http/RouteDispatcher.php(54): call_user_func_array(Array, Array)
#13 /home/typo3/typo3_src-7.6.16/typo3/sysext/backend/Classes/Http/RequestHandler.php(168): TYPO3\CMS\Backend\Http\RouteDispatcher->dispatch(Object(TYPO3\CMS\Core\Http\ServerRequest), Object(TYPO3\CMS\Core\Http\Response))
#14 /home/typo3/typo3_src-7.6.16/typo3/sysext/backend/Classes/Http/RequestHandler.php(95): TYPO3\CMS\Backend\Http\RequestHandler->dispatch(Object(TYPO3\CMS\Core\Http\ServerRequest))
#15 /home/typo3/typo3_src-7.6.16/typo3/sysext/core/Classes/Core/Bootstrap.php(302): TYPO3\CMS\Backend\Http\RequestHandler->handleRequest(Object(TYPO3\CMS\Core\Http\ServerRequest))
#16 /home/typo3/typo3_src-7.6.16/typo3/sysext/backend/Classes/Http/Application.php(94): TYPO3\CMS\Core\Core\Bootstrap->handleRequest(Object(TYPO3\CMS\Core\Http\ServerRequest))
#17 /home/typo3/typo3_src-7.6.16/typo3/index.php(20): TYPO3\CMS\Backend\Http\Application->run()
#18 [internal function]: {closure}()
#19 /home/typo3/typo3_src-7.6.16/typo3/index.php(21): call_user_func(Object(Closure))
#20 {main}

1

new line

#0 /home/typo3/typo3_src-7.6.16/typo3/sysext/backend/Classes/Form/FormDataProvider/AbstractItemProvider.php(1142): TYPO3\CMS\Core\Utility\GeneralUtility::trimExplode(',', Array, true)
#1 /home/typo3/typo3_src-7.6.16/typo3/sysext/backend/Classes/Form/FormDataProvider/TcaSelectItems.php(75): TYPO3\CMS\Backend\Form\FormDataProvider\AbstractItemProvider->processDatabaseFieldValue(Array, 'template')
#2 /home/typo3/typo3_src-7.6.16/typo3/sysext/backend/Classes/Form/FormDataGroup/FlexFormSegment.php(51): TYPO3\CMS\Backend\Form\FormDataProvider\TcaSelectItems->addData(Array)
#3 /home/typo3/typo3_src-7.6.16/typo3/sysext/backend/Classes/Form/FormDataCompiler.php(99): TYPO3\CMS\Backend\Form\FormDataGroup\FlexFormSegment->compile(Array)
#4 /var/www/html/typo3conf/ext/compatibility6/Classes/Form/FormDataProvider/TcaFlexProcess.php(549): TYPO3\CMS\Backend\Form\FormDataCompiler->compile(Array)
#5 /var/www/html/typo3conf/ext/compatibility6/Classes/Form/FormDataProvider/TcaFlexProcess.php(54): TYPO3\CMS\Compatibility6\Form\FormDataProvider\TcaFlexProcess->modifyDataStructureAndDataValuesByFlexFormSegmentGroup(Array, 'pi_flexform', Array)
#6 /home/typo3/typo3_src-7.6.16/typo3/sysext/backend/Classes/Form/FormDataGroup/TcaDatabaseRecord.php(51): TYPO3\CMS\Compatibility6\Form\FormDataProvider\TcaFlexProcess->addData(Array)
#7 /home/typo3/typo3_src-7.6.16/typo3/sysext/backend/Classes/Form/FormDataCompiler.php(99): TYPO3\CMS\Backend\Form\FormDataGroup\TcaDatabaseRecord->compile(Array)
#8 /home/typo3/typo3_src-7.6.16/typo3/sysext/backend/Classes/Controller/EditDocumentController.php(1118): TYPO3\CMS\Backend\Form\FormDataCompiler->compile(Array)
#9 /home/typo3/typo3_src-7.6.16/typo3/sysext/backend/Classes/Controller/EditDocumentController.php(1009): TYPO3\CMS\Backend\Controller\EditDocumentController->makeEditForm()
#10 /home/typo3/typo3_src-7.6.16/typo3/sysext/backend/Classes/Controller/EditDocumentController.php(2043): TYPO3\CMS\Backend\Controller\EditDocumentController->main()
#11 [internal function]: TYPO3\CMS\Backend\Controller\EditDocumentController->mainAction(Object(TYPO3\CMS\Core\Http\ServerRequest), Object(TYPO3\CMS\Core\Http\Response))
#12 /home/typo3/typo3_src-7.6.16/typo3/sysext/backend/Classes/Http/RouteDispatcher.php(54): call_user_func_array(Array, Array)
#13 /home/typo3/typo3_src-7.6.16/typo3/sysext/backend/Classes/Http/RequestHandler.php(168): TYPO3\CMS\Backend\Http\RouteDispatcher->dispatch(Object(TYPO3\CMS\Core\Http\ServerRequest), Object(TYPO3\CMS\Core\Http\Response))
#14 /home/typo3/typo3_src-7.6.16/typo3/sysext/backend/Classes/Http/RequestHandler.php(95): TYPO3\CMS\Backend\Http\RequestHandler->dispatch(Object(TYPO3\CMS\Core\Http\ServerRequest))
#15 /home/typo3/typo3_src-7.6.16/typo3/sysext/core/Classes/Core/Bootstrap.php(302): TYPO3\CMS\Backend\Http\RequestHandler->handleRequest(Object(TYPO3\CMS\Core\Http\ServerRequest))
#16 /home/typo3/typo3_src-7.6.16/typo3/sysext/backend/Classes/Http/Application.php(94): TYPO3\CMS\Core\Core\Bootstrap->handleRequest(Object(TYPO3\CMS\Core\Http\ServerRequest))
#17 /home/typo3/typo3_src-7.6.16/typo3/index.php(20): TYPO3\CMS\Backend\Http\Application->run()
#18 [internal function]: {closure}()
#19 /home/typo3/typo3_src-7.6.16/typo3/index.php(21): call_user_func(Object(Closure))
#20 {main}

1

Thank you for any response or help.

EDIT:

Here's the php function that create the warning

public static function trimExplode($delim, $string, $removeEmptyValues = false, $limit = 0)
{

if(is_array($string)){
    $e = new \Exception();
    $error_string = $e->getTraceAsString();
    $f = fopen('/var/www/html/custom.log', 'a+');
    fputs($f, PHP_EOL . "new line" . PHP_EOL);
    fputs($f, PHP_EOL . $error_string . PHP_EOL);
    fputs($f, PHP_EOL . print_r($string) . PHP_EOL);
    fclose($f);
}

    $result = explode($delim, $string);
    if ($removeEmptyValues) {
        $temp = [];
        foreach ($result as $value) {
            if (trim($value) !== '') {
                $temp[] = $value;
            }
        }
        $result = $temp;
    }
    if ($limit > 0 && count($result) > $limit) {
        $lastElements = array_splice($result, $limit - 1);
        $result[] = implode($delim, $lastElements);
    } elseif ($limit < 0) {
        $result = array_slice($result, 0, $limit);
    }
    $result = array_map('trim', $result);
    return $result;
}
  • 写回答

2条回答 默认 最新

  • dongmeng4742 2017-03-29 05:06
    关注

    You have to upgrade TYPO3 6.2 to typo3 7.6.x. In TYPO3 7.6 major changes in typo3 defult tables and tables fileds. So, if you don't follow all INSTALL TOOLS Upgrade Wizard steps and compare database specification. Then first follow all this steps.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 关于#linux#的问题(输入输出错误):出现这个界面接着我重新装系统,又让修电脑的师傅帮我扫描硬盘(没有问题)用着用着又卡死(相关搜索:固态硬盘)
  • ¥15 cv::resize不同线程时间不同
  • ¥15 web课程,怎么做啊😭没好好听课 根本不知道怎么下手
  • ¥15 做一个关于单片机的比较难的代码,然后搞一个PPT进行解释
  • ¥15 python提取.csv文件中的链接会经常出现爬取失败
  • ¥15 数据结构中的数组地址问题
  • ¥15 maya的mel里,怎样先选择模型A,然后利用mel脚本自动选择有相同名字的模型B呢。
  • ¥15 Python题,根本不会啊
  • ¥15 会会信号与系统和python的来
  • ¥15 关于#python#的问题