2017-04-24 49 views
0

我已经在TYPO3 6.2下启动了一个扩展,并将其迁移到TYPO3 7.现在看起来,控制器/操作组合的所有链接都被破坏了。 在我的TypoScript我已设置:plugin.xx.view.pluginNamespace =该插件不允许控制器

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.

例外。如果我的pluginname添加到URI这样

http://www.example.com/index.php?id=42&tx_extensionname_pi2[controller]=Basket

没有expecption被抛出。但是,如果我这样调用

http://www.example.com/index.php?id=42&tx_extensionname_pi2[controller]=Basket&tx_extensionname_pi2[action]=add

此操作的动作被从不叫。首先调用控制器。

几个星期前我做了更新,它只是一个开发系统,但今天我清除了所有缓存和错误信息。我错过了插件组合命名空间和注册/配置/链接的东西吗?

+0

你说你的插件名称是“Pi2”,但是你的URL参数名以'_pi1'结尾。检查将其更改为“_pi2”时会发生什么情况。 – Jost

+0

对不起,在这里写错了。我用pi2调用它,发生错误。修正了上面的文章 –

+0

'registerPlugin'和'configurePlugin'中的插件名称之间的差异是否也是拼写错误? – Jost

回答

0

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

plugin.tx_extensionname.mvc.callDefaultActionIfActionCantBeResolved = 1 

随着callDefaultActionIfActionCantBeResolved = 0或缺少上述,我得到的不允许例外。设置为1 Controller和Action被调用。

相关问题