Issue Bug Closed

#91743Using 'foreign_table_where' in selects in TCA TYPO3 v. 9 has changed...

Claus Harup 07/05/20, 16:17 updated 02/06/26, 11:51

Description

Having this (normal) TCA:

...
'region' => [
        'label' => $labelPrefix . '.region',
        'config' => [
            'type' => 'select',
            'renderType' => 'selectSingle',
            'items' => [
                ['LLL:EXT:tc_sys/Resources/Private/Language/locallang_db.xlf:choose', 0]
            ],
            'default' => 0,
            'foreign_table' => 'tx_tcsys_domain_model_category',
            'foreign_table_where' => 'AND tx_tcsys_domain_model_category.pid = ###PAGE_TSCONFIG_ID### ORDER BY tx_tcsys_domain_model_category.title'
        ]
]
...

….leaves my editors with NO items in region selctorbox IF they can not see the folder (uid = ###PAGE_TSCONFIG_ID###) holding the regions in the pagetree….

This has not been the case in previous version of TYPO3

The issue can be addressed here:

sysext/backend/Classes/Form/FormDataProvider/AbstractItemProvider.php

line 1028

$queryBuilder->andWhere($backendUser->getPagePermsClause(Permission::PAGE_SHOW));

makes sure that no references to any tableNames is possible if the editor does NOT have permission to see the folder holding these objets….

That leaves developers no possibility to reference to objects that the editor should ONLY choose and NOT see in the pagetree :-(

Reviews 0

No change resolves or names this issue in its commit message, and no comment links one.

History 1

  1. Georg Ringer commented and changed status New Closed 02/06/26, 11:51

    Thanks for creating the issue. I have discussed that change and we won’t change it for the following reason: There are also usescases where this change because a feature. Imagine more than 2 sites/trees/sections and one user should only see one part. => only the for him relevant records are shown.

    I fully understand your usecase and it is also totally valid – same as the one I described. Therefore I am closing the issue. However, of course this can easily modified by an extension, having e.g. a custom TCA option to react on that.

    hope you understand, if you got questions, just contact me on slack