douwen3127 2018-10-22 08:10
浏览 92
已采纳

TYPO3 PHP更新到7.0 | 日志说“Switch语句可能只包含一个默认子句”

I want to update PHP from 5.6 to 7.0 but I get a 500 HTML Error and in the logs it says:

[Mon Oct 22 09:42:14 2018] [-:error] [pid 12784] [client 5.158.158.123] [host www.mydomain.de] PHP Fatal error:  Switch statements may only contain one default clause in /is/htdocs/wp12731216_QEO0DONMD6/www/typo3conf/ext/dam/lib/class.tx_dam_db.php on line 547

So I looked into the file and found as it says a dublicate default: statement:

if ($appendType = $TCA['tx_dam']['columns'][$field]['config']['appendType']) {
    $appended = true;
    switch($appendType) {
        case 'space':
            $rowUpdate[$field] = trim($row[$field].' '.$value);
            break;
        case 'newline':
            $rowUpdate[$field] = $row[$field].($row[$field]?"
":'').$value;
            break;
        case 'comma':
            $rowUpdate[$field] = $row[$field].($row[$field]?', ':'').$value;
            break;
        case 'charDef':
            default:
            list($type, $appendChar) = explode(':', $appendType);
            $rowUpdate[$field] = $appendChar.$value;
            break;
        default:
            $appended = false;
            break;
    }
}

So my Question is, is there a solution? Can I just edit this file and remove the last default statement? Or should I update to a different PHP Version?

  • 写回答

1条回答 默认 最新

  • duanguane1670 2018-10-22 08:27
    关注

    So I found the solution myself after a while...

    I had to update the Extension where the file with the error comes from.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 merge函数占用内存过大
  • ¥15 Revit2020下载问题
  • ¥15 使用EMD去噪处理RML2016数据集时候的原理
  • ¥15 神经网络预测均方误差很小 但是图像上看着差别太大
  • ¥15 单片机无法进入HAL_TIM_PWM_PulseFinishedCallback回调函数
  • ¥15 Oracle中如何从clob类型截取特定字符串后面的字符
  • ¥15 想通过pywinauto自动电机应用程序按钮,但是找不到应用程序按钮信息
  • ¥15 如何在炒股软件中,爬到我想看的日k线
  • ¥15 seatunnel 怎么配置Elasticsearch
  • ¥15 PSCAD安装问题 ERROR: Visual Studio 2013, 2015, 2017 or 2019 is not found in the system.