TYPO3 扩展迁移 [英] TYPO3 extension migration

查看:40
本文介绍了TYPO3 扩展迁移的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I'm trying to migrate an old extension from TYPO3 4.7 to 7.6. Problem is I do not get any error output, only having my backend refreshed which makes it difficult for the debugging. Maybe someone can see what's wrong in the code that's causing this. This extension has been developed on PHP 5.3, I'm using 5.6 on TYPO3 7.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>';
    }
}

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

I have changed some deprecated namespaces, but the refresh happens when pressing submit button.

推荐答案

我想你错过了 TYPO3 6.2 的改编

I think you missed the adaption for TYPO3 6.2

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

in 6.2 all the old classnames were still available. so your extension works and you can generate a deprecation log.

也许您可以使用 7 中可用的兼容性 6 层.否则您需要盲目地更正旧的扩展:指定具有完整命名空间的所有类,找到已弃用的函数和类的替代品.

Maybe you can use the compatibility6 layer available in 7. otherwise you need to correct your old extension blindly: specify all classes with full namespaces, find replacements for deprecated functions and classes.

弃用列表:
- 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

这篇关于TYPO3 扩展迁移的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆