Issue Bug Closed

#84568chash not generated

Frank Buijze 03/30/18, 21:35 updated 01/10/22, 19:36

Description

The following problem occurs if one creates a plugin with multiple controller, action combinations.

If one generates a link without additional arguments for the first action in the first controller in the configuration no chash will be generated. This in turn causes a “cHash empty” error if a POST ajax call is made to the generated url.

If one inserts a fake action before the first action in the list a cHash will be generated for the now second action. When a call is made to this new url everything works as expected and the “cHash empty” message is gone.

Four possible solutions:
- Adjust the chash check for this particular situation. No arguments, no cHash check (probably the preferred one)
- Generate a cHash for the first action as well
- Introduce an option to force the generation of a cHash in Fluid, even if it’s the default action
- Describe this situation in the documentation

<f:uri action="getUsersViaAjaxAdmin" controller="User" pagetype="500"></f:uri>

ext_localconf.php

\TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin(
‘FraJaWeB.’.$_EXTKEY,
‘AjaxAdmin’,
array(
‘User’ => ‘getUsersViaAjaxAdmin’,
‘Customer’ => ‘getCustomersViaAjaxAdmin’,
),
// non-cacheable actions
array(
‘User’ => ‘getUsersViaAjaxAdmin,
‘Customer’ => ‘getCustomersViaAjaxAdmin’,
)
);

My temporary fix:

\TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin(
‘FraJaWeB.’.$_EXTKEY,
‘AjaxAdmin’,
array(
‘User’ => ‘bogus,getUsersViaAjaxAdmin’,
‘Customer’ => ‘getCustomersViaAjaxAdmin’,

),
// non-cacheable actions
array(
‘User’ => ‘getUsersViaAjaxAdmin,
‘Customer’ => ‘getCustomersViaAjaxAdmin’,
)
);

Reviews 0

No change resolves or names this issue in its commit message, and no comment links one.