4

I wrote an extension and the implementation of the Plugin via backend does everything correctly.

But when I try to implement my extension via typoscript I got this error everytime:

Oops, an error occurred!

The default controller can not be determined. Please check for Tx_Extbase_Utility_Extension::configurePlugin() in your ext_localconf.php.

and I don't know why.. I have tried different implementations (per tx_extbase_core_bootstrap->run or tx_extbase_dispatcher->dispatch and with additional information and without) and the current typoscript looks like this:

plugin.tx_graphichmenu {
    settings {
        menuUid = 1
    }
}

lib.tx_graphichmenu = USER
lib.tx_graphichmenu {
    userFunc = tx_extbase_core_bootstrap->run
    extensionName = Graphichmenu
    pluginName = Graphicmenu
    controller = MenuController
    action = showAction
}

temp.mainTemplate.subparts.stickyfooter < lib.tx_graphichmenu

i double- and triple-checked everything and i found not a single fault... tried it without the "action" and "controller" part and nothing changed

my configurePlugin part in the ext_localconf.php looks like this:

Tx_Extbase_Utility_Extension::configurePlugin(
    $_EXTKEY,
    'Graphicmenu',
    array(
        'Menu' => 'show',
    ),
    // non-cacheable actions
    array(
        'Menu' => '',
    )
);

The "show" action got no parameters. in there I load the ts settings from where I take the Uid of the object to display

PS: after every change i have cleared the cache and deleted the "temp_CACHED_..." files in typo3conf

Daniel
  • 6,916
  • 2
  • 36
  • 47
Kai
  • 53
  • 2
  • 6

1 Answers1

7

You need to modify your bootstrap, there's a general syntax:

lib.foo = USER
lib.foo {
    userFunc = tx_extbase_core_bootstrap->run
    extensionName = YourExtension
    pluginName = YourPlugin
    vendorName = YourVendor
    switchableControllerActions {
        Standard {
            1 = action2
            2 = action3
        }
    }
}

Note: CamelCase in extensionName value is important! (Thanks to Kai for confirmation) so if extkey is: kai_some_extension it has to be written as KaiSomeExtension

So in your case it should be something like:

lib.foo = USER
lib.foo {
    userFunc = tx_extbase_core_bootstrap->run
    extensionName = GraphicHmenu
    pluginName = Graphicmenu
    switchableControllerActions {
        Menu {
            1 = show
        }
    }
}
Community
  • 1
  • 1
biesior
  • 55,576
  • 10
  • 125
  • 182
  • Can anyone guide me to some reference material on this? What is "switchable" with the switchable controller actions? Why are they organized as an array of arrays, when it seems most people only use "1 = action" to seemingly force the default action into the one they want? So: my follow-up question is really: where can I find the "General syntax" (and its variants) referred to here? – norwebian Nov 21 '13 at 11:52
  • It's typical TypoScript you can write it as well in this way: `switchableControllerActions.Menu.1 = show` – biesior Nov 21 '13 at 12:55
  • Thanks, @biesior, but let me rephrase the question: "Where do you find the general syntax you refer to?" I realize it is typoscript, but I cant find the ExtBase TSref, so to speak. I have created a new question to account for my research and findings so far: http://stackoverflow.com/questions/20123037/where-is-extbase-reference-material-available – norwebian Nov 21 '13 at 14:05