2017-04-24 47 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被調用。

相關問題