TYPO3 Extbase action called twice

1.5k Views Asked by At

I noticed that on some of my TYPO3 7.6 extensions an action seems to get called twice, for example a listAction. If I put a vardump or an echo there it gets outputted twice, however the template is shown correctly once. I cannot discover any error in the code. The weird thing is on another site it does not happen with the same extension.

What could be the reason for this and how can I debug this?

4

There are 4 best solutions below

2
On BEST ANSWER

Maybe you are using page.10.variables? Check my answer here what is the best usage of typoscript in fluid templates?

6
On

Maybe the plugin is inserted twice on that page? Create a new plugin on another page and see if theres a double debug, too.

0
On

I noticed something similar when using fluidTYPO3. The cause was that the configuration-section of the fluid-template had to be parsed and executed to build the flexform structure to read and write the flexform-data. So the template might be parsed and executed twice but the php action is only called once. You can test this by dumping some variable in your action with: \TYPO3\CMS\Extbase\Utility\DebuggerUtility::var_dump($data, __FILE__.':L'.__LINE__);

0
On

For me non-cacheable action in ext_localconf.php solved the problem

    // non-cacheable actions
    array(
        'ControllerName' => 'list, show, create, update',
        
    )