【发布时间】:2017-04-24 11:26:40
【问题描述】:
我已经在 TYPO3 6.2 下启动了一个扩展,并将其迁移到 TYPO3 7。现在看来,与控制器/动作组合的所有链接都已损坏。 在我的 TypoScript 中,我设置了:
plugin.tx_extensionname.view.pluginNamespace = tx_extensioname
在ext_tables.php我已经设置:
\TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerPlugin(
$_EXTKEY,
'Pi1',
'Controller1: DoSomeLogic1'
);
....
\TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerPlugin(
$_EXTKEY,
'Pi12',
'Controller12: DoSomeLogic12'
);
在ext_localconf.php 中配置插件:
\TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin(
'MRU.' . $_EXTKEY,
'Pi2',
array(
'Basket' => 'list, add, remove, address, setDeliveryCountryJson',
'Order' => 'directorder, savedirectorder, accountorder, loginorder, saveloginorder, saveaccountorder, overview, doOrder, paymentSuccess, paymentFailure, paymentNotification, paymentCancel',
'Payment' => 'index'
),
// non-cacheable actions
array(
'Basket' => 'list, add, remove, address, setDeliveryCountryJson',
'Order' => 'directorder, savedirectorder, accountorder, loginorder, saveloginorder, saveaccountorder, overview, doOrder, paymentSuccess, paymentFailure, paymentNotification, paymentCancel',
'Payment' => 'index'
)
);
在页面 (id 42) 上,我放置了插件 Pi2。篮子控制器与列表动作一起显示。一切都好。网址是这样的:
http://www.example.com/index.php?id=42
如果我添加命名空间控制器参数,像这样
http://www.example.com/index.php?id=42&tx_extensionname[controller]=Basket
我立刻得到了
#1313855173: The controller "Basket" is not allowed by this plugin. Please check for TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin() in your ext_localconf.php.
例外。如果我像这样将插件名称添加到 URI 中
http://www.example.com/index.php?id=42&tx_extensionname_pi2[controller]=Basket
不会引发任何期望。但是如果我调用这样的动作
http://www.example.com/index.php?id=42&tx_extensionname_pi2[controller]=Basket&tx_extensionname_pi2[action]=add
这个动作永远不会被调用。调用具有第一个操作的控制器。
几周前我进行了更新,它只是一个开发系统,但今天我清除了所有缓存并且发生了错误。我是否错过了与插件组合命名空间及其注册/配置/链接相关的内容?
【问题讨论】:
-
您说您的插件名称是“Pi2”,但您的 URL 参数名称以
_pi1结尾。检查将其更改为_pi2时会发生什么。 -
对不起,这里写错了。我用pi2调用它,发生错误。已在上面的帖子中修复
-
registerPlugin和configurePlugin中插件名称的区别也是错字吗? -
是的。在我的环境中它是平等的。这些插件在 6.2 LTS 下运行了 6 个月...