90205[TASK] Add iterable types to toolbar item cache actions array
Commit message
Review
-
Code review CR +2 Done
- Benjamin Franzke +2
- Oliver Klee +1
-
Verified V +2 Done
- Benjamin Franzke +2
- Oliver Klee +1
- core-ci +1 CI
Issues 1
Files 3
Review log 1923
-
Elias Häußler uploaded patch set 1 07/31/25, 10:19
-
core-ci voted on patch set 1 V +1 07/31/25, 10:27 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/82581
-
Oliver Klee commented on patch set 1 07/31/25, 12:25
ModifyClearCacheActionsEvent.php:36This looks like there's an `array` or `list` missing.ClearCacheToolbarItem.php:41Can/should any of these be of type `non-empty-string`? -
Elias Häußler uploaded patch set 2
V +107/31/25, 12:36 -
Elias Häußler commented on patch set 1 07/31/25, 12:36
ModifyClearCacheActionsEvent.php:25ReplyLet's see what others say :) I did something similar in https://review.typo3.org/c/Packages/TYPO3.CMS/+/89732, which was also accepted.ModifyClearCacheActionsEvent.php:36ReplyThis method is about adding a single cache action, hence the `CacheAction` type (which in turn is described as array in https://review.typo3.org/c/Packages/TYPO3.CMS/+/90205/1/typo3/sysext/backend/Classes/Backend/Event/ModifyClearCacheActionsEvent.php#25).ClearCacheToolbarItem.php:41ReplyGood catch, thanks! Reading the appropriate template (https://github.com/TYPO3/typo3/blob/v13.4.15/typo3/sysext/backend/Resources/Private/Templates/ToolbarItems/ClearCacheToolbarItemDropDown.html), it looks like everything – except `description` – should be non-empty. -
Elias Häußler uploaded patch set 3 07/31/25, 12:39
-
Elias Häußler commented on patch set 2 07/31/25, 12:40
ClearCacheToolbarItem.php:41ReplyI decided to make `description` optional and, if set, to enforce a non-empty string. I think that's the most common scenario here. -
core-ci voted on patch set 2 V +1 07/31/25, 12:44 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/82586
-
core-ci voted on patch set 3 V +1 07/31/25, 12:47 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/82587
-
Oliver Klee commented on patch set 3 07/31/25, 13:05
ModifyClearCacheActionsEvent.php:36ReplyAh, my bad, you're right, I misread the method.ClearCacheToolbarItem.php:41ReplyDone -
Oliver Klee commented on patch set 3 07/31/25, 13:05
ModifyClearCacheActionsEvent.php:25ReplyDone -
Oliver Klee voted on patch set 3 CR +1 V +1 07/31/25, 13:06
-
Benjamin Franzke commented on patch set 3 08/01/25, 10:54
ClearCacheToolbarItem.php:38While our code assumes that `severity` is given (but also works without) – https://github.com/TYPO3/typo3/blob/v13.4.15/typo3/sysext/backend/Resources/Private/Templates/ToolbarItems/ClearCacheToolbarItemDropDown.html#L8 – github code search (https://github.com/search?q=ModifyClearCacheActionsEvent&type=code) reveals quite some extensions that do not provide this value: https://github.com/MaxServ/t3ext-fal_s3/blob/master/Classes/Resource/Event/FlushCacheActionEvent.php#L55-L61 https://github.com/cobwebch/flush_language_cache/blob/46c1bb400ec14872c0b4e97d2fbab64cab937761/Classes/EventListener/ClearCacheListener.php#L45-L53 https://github.com/nitsan-technologies/ns_cloudflare/blob/6655847a1006fdf46a9440853e9d29707e135c13/Classes/Backend/Event/CloudflareClearCacheActionsEventListener.php#L39-L45 Looking into the documentation it became clear why: https://docs.typo3.org/m/typo3/reference-coreapi/main/en-us/ApiOverview/Events/Events/Backend/ModifyClearCacheActionsEvent.html It's currently not documented (not a blaming, that's simply because the option was added for internal styling with https://review.typo3.org/c/Packages/TYPO3.CMS/+/75658/13/typo3/sysext/backend/Resources/Private/Templates/ToolbarItems/ClearCacheToolbarItemDropDown.html#8 later on). Therefore I think we should make this an optional value like `description` and ideally list valid strings (notice,info,succcess,warning,error) while we're at it. (and cc @garvin@hick.ing maybe we can pick this up in the documentation) -
Elias Häußler commented on patch set 3 08/01/25, 11:29
ClearCacheToolbarItem.php:38ReplyThank you for this detailed answer and the additional insights! When making `severity` optional, should we adapt the template as well to avoid classes like `text-` (in case no severity is given)? Or does that go beyond the scope of this patch? -
Benjamin Franzke commented on patch set 3 08/01/25, 11:45
ClearCacheToolbarItem.php:38Replyyea, good idea, we can do that as a drive-by within this patch. -
Garvin Hicking commented on patch set 3 08/01/25, 12:06
ClearCacheToolbarItem.php:38ReplyI'll take care of adopting docs, thanks for the ping. -
Elias Häußler uploaded patch set 4
CR +1V +108/01/25, 12:29 -
Elias Häußler commented on patch set 4 08/01/25, 12:29
ClearCacheToolbarItem.php:38ReplyDone -
core-ci voted on patch set 4 V +1 08/01/25, 12:36 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/82634
-
Oliver Klee voted on patch set 4 CR +1 V +1 08/01/25, 13:27
-
Benjamin Franzke voted on patch set 4 CR +2 V +2 08/01/25, 13:56
-
Benjamin Franzke merged patch set 5 08/04/25, 06:21
-
Moritz Ngo commented on patch set 5 08/15/25, 11:23
ClearCacheToolbarItem.php:41UnresolvedIt seems, that `'danger'` is missing in the list of possible severity entries ```suggestion * severity?: 'notice'|'info'|'succcess'|'warning'|'error'|'danger', ``` I mean `'danger'` will be used in line 91. or is this intentional, that `'danger'` was omitted?
ModifyClearCacheActionsEvent.php:25