Project

General

Profile

Actions

Bug #93582

closed

filter methods of TCA type group are not evaluated for non-admins in Element Browser

Added by S P almost 4 years ago. Updated over 2 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Documentation
Target version:
-
Start date:
2021-02-24
Due date:
% Done:

0%

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

Description

Defining a filter for a group field, like this:

'filter' => [
    ['userFunc' => \Vendor\Package\FilterClass::class . '->filter']
]

According to the documentation the filtering has to happen always in the Element Browser (and the DataHandler):
https://docs.typo3.org/m/typo3/reference-tca/9.5/en-us/ColumnsConfig/Type/Group.html#filter

However, the filter is only evaluated in DataHandler for all users. The evaluation of the filter in the Element Browser happens only for admin users and is totally ignored for non-admins.

To test: just put a syntax error in the filter method -> for admins opening the element browser will give a 500, for non-admins it loads without filter.

In my case I only allow table pages, if this is relevant.

Discovered in v9, probably relevant for 10+ as well.

Actions #1

Updated by Georg Ringer over 3 years ago

  • Status changed from New to Needs Feedback

can you test that on version 10 as I couldn't reproduce that in 10 having a filter in an irre element.
if it still doesn't work, please add a test extension or tca snippet how this can be tested - thanks a lot!

Actions #2

Updated by S P over 3 years ago

I currently don't have a v10 version where I could test it.

However, I'm not sure if I rather stumbled over a documentation flaw instead of an actual bug. The documentation does not clearly say what it is that can be filtered.

What are the filters supposed to filter, actually? I tried to filter the left side of the element browser, where the page tree is rendered (I only need to show specific subtrees and not everything that the user is permitted to see). However, it appears the filter only applies to the right side (the list view of the element browser).

For admin users the page tree always has root pre-selected and I could filter on the first level of the page tree (direct call on filter classes upon opening the element browser). For non-admins no page tree item seems to be selected initially (and maybe thus the filter was not loaded directly on opening the element browser).

I solved it in my case by simply taking a selectTree on pages with setting the rootUid instead, which was sufficient for my use case.

Actions #3

Updated by Georg Ringer over 3 years ago

to be honest, I never have seen or used this setting before ;)

Actions #4

Updated by S P about 3 years ago

  • Category changed from Backend API to Documentation
  • TYPO3 Version changed from 9 to 10

I changed this to a bug in Documentation. It's not documented what it is that is actually filtered. If you know that the right side (and not the left) is filtered, then this feature works.

Actions #5

Updated by Nikita Hovratov over 2 years ago

  • Status changed from Needs Feedback to Closed
Actions

Also available in: Atom PDF