0
votes

in TYPO3 7.6 I defined a Frontend Plugin which is of type "PLUGIN_TYPE_CONTENT_ELEMENT".

ext_localconf.php:

ExtensionUtility::configurePlugin(
    'MyVendor.' . $_EXTKEY,
    'Maildownload',
    ['Maildownload' => 'show'],
    [],
    ExtensionUtility::PLUGIN_TYPE_CONTENT_ELEMENT
);

the configurePlugin method creates a typoScript Setup, where the the "run()" method of Extbase's Bootstrap class is called:

...
tt_content.myext_maildownload.20 = USER
tt_content.myext_maildownload20.userFunc = TYPO3\CMS\Extbase\Core\Bootstrap->run
...

This means Extbase processes the request by calling the action "show" in the controller "Maildownload" of my extension.

I Call my plugin via ajax. That means, I define a page with a separate typenum and include the plugin via typoScript:

setup.ts:

ajax_page = PAGE
ajax_page {
  typeNum = 123
  config.disableAllHeaderCode = 1
  config.metaCharset = UTF-8
  config.debug = 0
  config.additionalHeaders = Content-type:application/json
  config.xhtml_cleaning = 0
  config.adminPanel = 0

  10 < tt_content.myext_maildownload
}

When I call the page index.php?type=123 the action "show" in the controller "Maildownload" will be executed.

After upgrading to TYPO3 8.7 this behaviour has obviously changed.

The generated typoScript code of the "configurePlugin()" method is still the same. When I call page index.php?type=123 TYPO3 renders it like an ordinary content element and does not call the TYPO3\CMS\Extbase\Core\Bootstrap->run method anymore. So my showAction method will not be called.

I could define a dataProcessor class now and move the showAction into it. But that is not a great solution, because I don't want to bypass the complete extbase renderering process.

Is there now a new way to include my plugin into the page so that it will be treated like an extbase plugin and not like a content element?

1
define the pluginName,vendorName to the tt_content.myext_maildownload20. and if you don't have in url controller and action name use switchableControllerActionsAndrei Todorut

1 Answers

0
votes

@andrei thank you for your reply, but it did not hit the point.

Meanwhile I found out that the cause for the problem was this breaking change in TYPO3 8.5: https://docs.typo3.org/typo3cms/extensions/core/Changelog/8.5/Breaking-78002-EnforceCHashArgumentForExtbaseActions.html?highlight=chash

so a possible solution is to set the requireCHashArgumentForActionArguments to false in the typoScript plugin settings:

plugin.tx_myextension {

   features.requireCHashArgumentForActionArguments = 0

   ...

}