How do I bootstrap a plugin on TYPO3 CMS 6.0 with extbase?
Asked Answered
B

2

8

I'm trying to use an extbase plugin through typoscript on TYPO3 CMS 6.0. I used the following code, that I found repeated all over the web:

10 = USER
10 { 
    userFunc = tx_extbase_core_bootstrap->run
    pluginName = Sermons
    extensionName = VmfdsSermons
    switchableControllerActions {
        Sermon {
            1 = byLatestSeries
            2 = list
            3 = show
    }
}

However, this just gives me the following error:

#1289386765: Could not analyse class:Tx_VmfdsSermons_Controller_SermonController maybe not loaded or no autoloader?

It seems to me as if tx_extbase_core_bootstrap->run is not using namespaces yet, thus trying to load a class called Tx_VmfdsSermons_Controller_SermonController when it should have called \TYPO3\VmfdsSermons\Controller\SermonController. Is there a way around this?

Baca answered 27/12, 2012 at 21:20 Comment(0)
P
13

You're searching for the property vendorName. So in your case it should be:

10 = USER
10 { 
    userFunc      = TYPO3\CMS\Extbase\Core\Bootstrap->run

    pluginName    = Sermons
    extensionName = VmfdsSermons
    vendorName    = TYPO3
    [...]

I also used the vendor namespace within ext_localconf.php:

\TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin(
    '<Vendor>.' . $_EXTKEY, 
    [...]

I found the answer by using the debugger. I started at \TYPO3\CMS\Extbase\Mvc\Dispatcher::resolveController() and jumped into TYPO3\CMS\Extbase\Mvc\Request::getControllerObjectName(). There is a member controllerVendorName, so I searched in Extbase for the setter of \TYPO3\CMS\Extbase\Mvc\Request::setControllerVendorName(), precisely just for setControllerVendorName, and got a match in \TYPO3\CMS\Extbase\Mvc\Web\RequestBuilder::build(), where is a member called vendorName, and just in the method above \TYPO3\CMS\Extbase\Mvc\Web\RequestBuilder::loadDefaultValues(), is the answer!

Pierpont answered 8/1, 2013 at 14:12 Comment(0)
C
7

Calling tx_extbase_core_bootstrap should no longer be used as it is deprecated in ver. 6.0 and will be removed in 7.0

You can try different. Developers should now handle everything with namespaces ...

You can use this:

# bootstrap aufrufen -> run from extbase

userFunc = TYPO3\CMS\Extbase\Core\Bootstrap->run
Conga answered 30/12, 2012 at 18:46 Comment(1)
You're right, of course, but this does not solve my problem. Setting vendorName = TYPO3 did, however.Baca

© 2022 - 2024 — McMap. All rights reserved.