此插件

时间:2017-04-24 11:26:40

标签: typo3 fluid extbase

我已经在TYPO3 6.2下启动了扩展,并将其迁移到TYPO3 7.现在看来,所有到Controller / Action组合的链接都被破坏了。 在我的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

如果我添加命名空间的Controller参数,就像这样 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

此动作永远不会被调用。控制器及其第一个动作被调用。

几周前我做了更新,它只是一个开发系统,但是今天我清除了所有缓存并且出现了错误。我是否错过了插件组合命名空间及其注册/配置/链接的内容?

1 个答案:

答案 0 :(得分:0)

好的,这似乎解决了我的问题:

plugin.tx_extensionname.mvc.callDefaultActionIfActionCantBeResolved = 1

使用callDefaultActionIfActionCantBeResolved = 0或遗漏上述内容,我会收到不允许的例外情况。将此设置为1调用控制器和操作。