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 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 保护模式-系统加载-段寄存器
  • ¥15 电脑桌面设定一个区域禁止鼠标操作
  • ¥15 求NPF226060磁芯的详细资料