我已经在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
此操作的动作被从不叫。首先调用控制器。
几个星期前我做了更新,它只是一个开发系统,但今天我清除了所有缓存和错误信息。我错过了插件组合命名空间和注册/配置/链接的东西吗?
你说你的插件名称是“Pi2”,但是你的URL参数名以'_pi1'结尾。检查将其更改为“_pi2”时会发生什么情况。 – Jost
对不起,在这里写错了。我用pi2调用它,发生错误。修正了上面的文章 –
'registerPlugin'和'configurePlugin'中的插件名称之间的差异是否也是拼写错误? – Jost