Bug #106175
openitemsProcFunc does nothing with type=selectTree
0%
Description
The documentation mentions the usage of itemsProcFunc in combination with the selectTree-type. This option however does nothing. If I change the type from selectTree to selectMultipleSideBySide, my class is being used and I can alter the items array.
Either the documentation is wrong here, or there is a bug with the selectTree.
I am trying to use this in a FlexForm context.
Updated by Kevin Ditscheid about 1 month ago
I know now what is going on here. I have neither items, nor pageTS to fill any items. The code ignores itemsProcFunc, if this is the case. The other select types are fetching the items from the database and apply itemsProcFunc on that list, too, but selectTree does not.
Updated by Oliver Hader 26 days ago
Can you please share the FlexForm configuration? Thx
Updated by Kevin Ditscheid 26 days ago
ยท Edited
Oliver Hader wrote in #note-2:
Can you please share the FlexForm configuration? Thx
Hi, yes:
<settings.tagRestrictions>
<label>LLL:EXT:sg_news/Resources/Private/Language/locallang_db.xlf:plugin.flexForm.tags</label>
<config>
<type>select</type>
<renderType>selectTree</renderType>
<size>10</size>
<maxitems>9999</maxitems>
<foreign_table>sys_category</foreign_table>
<foreign_table_where>
AND sys_category.sys_language_uid IN (-1, 0) ORDER BY sys_category.sorting ASC
</foreign_table_where>
<itemsProcFunc>\SGalinski\SgNews\TCA\SelectItemProvider->filterTags</itemsProcFunc>
<treeConfig>
<parentField>parent</parentField>
<appearance>
<expandAll>1</expandAll>
<showHeader>1</showHeader>
</appearance>
</treeConfig>
</config>
</settings.tagRestrictions>
The issue is with TYPO3\CMS\Backend\Form\FormDataProvider\TcaSelectTreeItems, because the itemsProcFunc is only called, whith the staticItems and not with the dynamic items. There is also the issue, that all of the context is lost, because the list is being filled by an Ajax call. In result, I can not get the configuration of of other FlexForm fields (which is possible with the other select types mind you).
I basically wanted to filter the selectTree in relation to another field from the same Flexform (again, possible with other select-types, but not with selectTree).