Project

General

Profile

Actions

Bug #106175

open

itemsProcFunc does nothing with type=selectTree

Added by Kevin Ditscheid about 1 month ago. Updated 26 days ago.

Status:
New
Priority:
Should have
Assignee:
-
Category:
Backend API
Target version:
-
Start date:
2025-02-13
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
12
PHP Version:
8.3
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

https://docs.typo3.org/m/typo3/reference-tca/12.4/en-us/ColumnsConfig/Type/Select/Tree/Index.html#confval-select-tree-itemsprocfunc

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.

Actions #1

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.

Actions #2

Updated by Oliver Hader 26 days ago

Can you please share the FlexForm configuration? Thx

Actions #3

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).

Actions

Also available in: Atom PDF