Important: #109107 - Cache action endpoints should return JSON response
See forge#109107
Description
AJAX endpoints registered as custom cache actions via
\TYPO3\ should
return a JSON response containing
success,
title, and
message fields.
The clear-cache toolbar now treats a missing or non-
false
success
value as a successful operation and falls back to generic notification labels
when
title or
message are absent. While this keeps older
endpoints working without changes, providing explicit values gives users
meaningful, context-specific feedback and ensures error conditions are surfaced
correctly.
Hint
Update any custom cache action endpoint to return a structured JSON response:
use TYPO3\CMS\Core\Http\JsonResponse;
// Success
return new JsonResponse([
'success' => true,
'title' => $languageService->sL('myext.locallang:notification.success.title'),
'message' => $languageService->sL('myext.locallang:notification.success.message'),
]);
// Failure
return new JsonResponse([
'success' => false,
'title' => $languageService->sL('myext.locallang:notification.error.title'),
'message' => $languageService->sL('myext.locallang:notification.error.message'),
]);