Bug #88939
closedCustom CacheAction cannot send success state and custom flash messages
100%
Description
Content:
Add a cacheAction via $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['additionalBackendItems']['cacheActions']. Everything is fine and the cache icon is displayed in the topbar. Sending a JsonResponse via interface:
/**
* @param ServerRequestInterface $request
* @return ResponseInterface
*/
public function flush(ServerRequestInterface $request): ResponseInterface
{
return new JsonResponse(['success' => true]);
}
We get a red FlashMessage with the hardcoded "An error occurred while clearing the cache. It is likely not all caches were cleared as expected." text.
The message is thrown from https://github.com/TYPO3/TYPO3.CMS/blob/master/Build/Sources/TypeScript/backend/Resources/Public/TypeScript/Toolbar/ClearCacheMenu.ts#L72 because we have a response. It does not matter what is inside, as you can see.
Solution:
We need a proper solution for this typescript case. Luckily we have a similar solution here: https://github.com/TYPO3/TYPO3.CMS/blob/master/Build/Sources/TypeScript/recordlist/Resources/Public/TypeScript/ClearCache.ts#L67
Files
Updated by Gerrit Code Review over 5 years ago
- Status changed from New to Under Review
Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/61481
Updated by Gerrit Code Review over 5 years ago
Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/61481
Updated by Gerrit Code Review about 5 years ago
Patch set 3 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/61481
Updated by Gerrit Code Review about 5 years ago
Patch set 4 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/61481
Updated by Guido Schmechel about 5 years ago
- File ext_tables.php ext_tables.php added
- File FlushFoobarCache.php FlushFoobarCache.php added
- File AjaxRoutes.php AjaxRoutes.php added
Steps to reproduce (in a living extension):
- Change ext_tables.php
- Add Class (Classes/Hooks/Backend/FlushFoobarCache.php)
- Add Routes (Configuration/Backend/AjaxRoutes.php)
- Flush TYPO3 System Cache
- Reload Backend
Updated by Gerrit Code Review about 5 years ago
Patch set 5 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/61481
Updated by Gerrit Code Review about 5 years ago
Patch set 6 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/61481
Updated by Guido Schmechel about 5 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset f5f441751314379f87c980140ef466fc463780cb.
Updated by Gerrit Code Review about 5 years ago
- Status changed from Resolved to Under Review
Patch set 1 for branch 9.5 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/62001
Updated by Oliver Bartsch about 5 years ago
- Related to Bug #89447: The notification for an error while clearing the cache is not translatable added
Updated by Guido Schmechel almost 5 years ago
- Status changed from Under Review to Resolved
Applied in changeset 5bdd9baacb7f2bf5abc277815b27f4456e1eefc9.
Updated by Benni Mack almost 5 years ago
- Status changed from Resolved to Closed