#96461itemsProcFunc is not able to add itemGroups
Description
Before itemGroups was introduced, it was possible to add a [‘Some Label’, ‘—div—’] option to add grouped items from itemsProcFunc. This is not fully supported anymore because you dont have access to the itemGroups configuration.
You can still add groups but have no possibility of adding labels.
Lets assume you have an “itemsProcFunc” method which takes one parameter called $config:
1) You cant manipulate $config[‘itemGroups’] because ItemProcessingService has no support for it
2) You can not manipulate $config[‘config’][‘itemGroups’] because it is not passed as reference
3) You can not use ExtensionManagementUtility::addTcaSelectItemGroup, it modifies the TCA as expected but TcaSelectItems::addData already works with a local copy of the field config
Current possible workarounds:
1) keep using [‘LLL:label’, ‘—div—’]
con: will be deprecated, no future-proof solution
2) Dont use ‘LLL:label’ for the itemGroup Key, use the translated label
con: Does not “feel” right/consistant but works
3) Add the itemGroup via TCA Overrides
con: not as much straight-forward as it could be, more boilerplate code…
Possible solution:
A) pass the global TCA-config value to TcaSelectItems::groupAndSortItems
pro: Could alter itemGroups via ExtensionManagementUtility::addTcaSelectItemGroup
con: unpredictable side-effects possible
B) pass whole field config as reference
pretty much the same cons than A but the Utility method ExtensionManagementUtility::addTcaSelectItemGroup would not work
C) add itemGroups, sortItems and everything necessary to $processorParameters in AbstractItemProvider::resolveItemProcessorFunction
pro: you can alter itemGroups without any side-effects
con: The Utility method ExtensionManagementUtility::addTcaSelectItemGroup would not work
I would suggest Option C as a solution because it does only add some new options without changing anything else.
Reviews 1
Fix this issue
Start the commit message of your patch with this. Add what the patch does, and the versions it goes to in "Releases:". The changes above were merged or abandoned: read them before you start. How to create a patch
- Commit message
-
[BUGFIX] itemsProcFunc is not able to add itemGroups Resolves: #96461 Releases: main
History 4
-
Alexander Opitz commented <span data-processor="relativetime" data-value="2026-02-15T00:10:18+00:00" > 02/15/26, 00:10 </span>
+1 for this
-
Garvin Hicking commented <span data-processor="relativetime" data-value="2026-02-15T07:50:47+00:00" > 02/15/26, 07:50 </span>
Does 91285: [FEATURE] Introduce itemsProcessors over itemsProcFunc | https://review.typo3.org/c/Packages/TYPO3.CMS/+/91285 help here? (Have not properly read this just want to leave that here)
-
Alexander Opitz commented <span data-processor="relativetime" data-value="2026-02-15T10:22:26+00:00" > 02/15/26, 10:22 </span>
No, this doesn’t seam to help, as the processors only build a SelectItemCollection which doesn’t hold the itemGroups.
+1 for this. Its really bad that we can add items via a userFunc but not sort them correctly with custom labels given in a runtime filled itemGroups.