【问题标题】:plugin.xx.view.pluginNamespace = Controller are not allowed by this Pluginplugin.xx.view.pluginNamespace = 此插件不允许控制器
【发布时间】: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 个月...

标签: typo3 fluid extbase


【解决方案1】:

好的,看来这解决了我的问题:

plugin.tx_extensionname.mvc.callDefaultActionIfActionCantBeResolved = 1

使用callDefaultActionIfActionCantBeResolved = 0 或缺少上述内容,我得到了不允许的异常。将此设置为1 调用控制器和操作。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2019-07-09
    • 2020-03-19
    • 1970-01-01
    • 2015-05-13
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多