【问题标题】:TYPO3 extension migrationTYPO3 扩展迁移
【发布时间】:2017-12-20 10:13:19
【问题描述】:

我正在尝试将旧扩展从 TYPO3 4.7 迁移到 7.6。问题是我没有得到任何错误输出,只是刷新了我的后端,这使得调试变得困难。也许有人可以看到导致这种情况的代码有什么问题。这个扩展是在 PHP 5.3 上开发的,我在 TYPO3 7.6 上使用 5.6。

$linksToApproveWithoutCategory = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows( 'uid,label,pid,description,href', $theTable, $theField . '=' . $GLOBALS['TYPO3_DB']->quoteStr( $theValue, $theTable ) . ' ' . $whereClause, $groupBy, $orderBy, $limit );



if(count($linksToApproveWithoutCategory) > 0) {
    // Links without category
    for($i = 0; $i < count($linksToApproveWithoutCategory); $i++) {
        $content .= '<form action="' . $_SERVER['PHP_SELF'] . '" method="POST">';

        // Alternating row colors
        $content .= $switch ? '<tr bgcolor="' . $doc['bgColor5'] . '">' : '<tr>' ;
        $switch = !$switch;

        // Starting content
        $content .= '<td style="vertical-align:top;"><input type="text" name="label" value="' . $linksToApproveWithoutCategory[$i]['label'] . '" size="30" /></td>';
        $content .= '<td><textarea name="description" rows="5">' . \TYPO3\CMS\Core\Utility\GeneralUtility::formatForTextarea( $linksToApproveWithoutCategory[$i]['description'] ) . '</textarea></td>';
        $content .= '<td style="vertical-align:top;"><input type="text" name="href" value="' . $linksToApproveWithoutCategory[$i]['href'] . '" size="30" /></td>';

        $content .= '<td style="vertical-align:top;"><select name="categoryUID"><option value="0"></option>';

        foreach((array) $categories as $category) {
            $content .= '<option value="' . $category['uid'] . '">';

            if($category['parent_category'] > 0) {
                $content .= '-- ';
            }

            $content .= $category['label'] . '</option>';
        }
        $content .= '</select></td>';

        $content .= '<td style="vertical-align:top;"><input type="image" src="/fileadmin/user_upload/action_accept.gif" style="border:0px;" alt="' . $GLOBALS['LANG']->getLL( 'ViewLinksToApprove_accept' ) . '" title="' . $GLOBALS['LANG']->getLL( 'ViewLinksToApprove_accept' ) . '" /></td>';
        $content .= "<td style=\"vertical-align:top;\"><a href=\"?action=getViewDeleteLink&id=" . $this->id . "&uid=" . $linksToApproveWithoutCategory[$i]['uid'] . "\"><img src=/fileadmin/user_upload/action_delete.gif\" border=\"0\" alt=\"" . $GLOBALS['LANG']->getLL( 'ViewLinksToApprove_delete' ) . "\" title=\"" . $GLOBALS['LANG']->getLL( 'ViewLinksToApprove_delete' ) . "\"></a></td>";
        $content .= '</tr>';

        $content .= '<input type="hidden" name="id" value="' . $this->id . '" /><input type="hidden" name="uid" value="' . $linksToApproveWithoutCategory[$i]['uid'] . '" /><input type="hidden" name="action" value="getViewAcceptLink" /></form>';
    }
}

我更改了一些已弃用的命名空间,但在按下提交按钮时会发生刷新。

【问题讨论】:

    标签: php typo3


    【解决方案1】:

    我认为你错过了对 TYPO3 6.2 的改编

    在 6.2 中,所有旧的类名仍然可用。所以你的扩展工作,你可以生成一个弃用日志。

    也许你可以使用 7 中提供的兼容性 6 层。否则你需要盲目地纠正你的旧扩展:指定所有具有完整命名空间的类,找到不推荐使用的函数和类的替代品。

    弃用列表:
    - https://api.typo3.org/typo3cms/7/html/deprecated.html
    - https://api.typo3.org/typo3cms/62/html/deprecated.html
    - https://api.typo3.org/typo3cms/61/html/deprecated.html
    - https://api.typo3.org/typo3cms/60/html/deprecated.html
    - https://api.typo3.org/typo3cms/47/html/deprecated.html
    - https://api.typo3.org/typo3cms/45/html/deprecated.html

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-06-23
      • 2018-03-02
      • 2016-08-17
      • 2014-12-28
      相关资源
      最近更新 更多