Bug #91900
openEditor with language restriction to non-default language can't edit records of tables with inline fields configured with l10n_mode => exclude
0%
Description
In one of our projects we have a table for locations. This table has a file relation field for images, which is configured with 'l10n_mode' => 'exclude'.
The default language is German. There is a folder in the page tree, which contains only russian locations (they aren't translations of a german record, but created directly in russian).
When an editor, who is restricted to only the russian language, tries to edit those records, he gets an error: "Sorry, you didn't have proper permissions to perform this change. ERROR: Language was not allowed.".
This likely happens, because the file relation in sys_file_reference is created with sys_language_uid = 0 when l10n_mode is set to exclude, resulting in an error, because the editor can't access the default language.
I tested this in the most recent versions of TYPO3 8, 9 and 10. They all behave identically.
Files
Updated by Kevin Ditscheid over 4 years ago
- Related to Bug #84119: Limiting a BE-User to default language results in inconsistent saves. added
Updated by Anonymous almost 4 years ago
Facing a similar issue. Doe you already get "ERROR: Language was not allowed" on opening the record - or on save only?
Updated by Kevin Ditscheid about 2 years ago
- File 2022-10-20_10-53.png 2022-10-20_10-53.png added
- File 2022-10-20_10-51.png 2022-10-20_10-51.png added
This issue can still be reproduced in TYPO3 11.5.17.
A simple way to test this is using gridelements and create an element on a page, then translate the element and create a new element inside the default language element, but NOT translate that (see screenshot). Now switch to the language restricted user and click on the edit button.
Updated by Kevin Ditscheid about 2 years ago
I fixed this by editing backend/Classes/Form/FormDataProvider/DatabaseUserPermissionCheck.php and not throwing the AccessDeniedEditInternalsException, if the record has a language id === 0 and the inline parent having a language if !== 0.
This is a very dirty hack, that I am not willing to offer as a fix to the codebase, but I will append the diff here.
I am unsure on how to properly fix this, because imo this check should not even happen at this point.
Updated by Thomas Luzat over 1 year ago
Can confirm with TYPO3 11.5.24 and translated Gridelements, even though the page translation process created translated copies of the grid children (translated by copy, not reference).
The patch makes it work for me, but can't tell whether it limits access sufficiently as intended.
Updated by Steffen Krüchten over 1 year ago
I can also confirm this bug in TYPO3 11.5.29 and translated "Container" content elements. Editors with access only to the spanish language and not the english default get an error with container elements that have a Media-Element in their configuration options (we use it to set a background-image of the container).
Without the image relation everything works fine but if the original has the relation set an editor without access to the default language gets an error message.
The Workaround above also works for me, not seeing any security problems as result of it for now.
Updated by S P 21 days ago
- Related to Bug #93266: Backend-User restricted to language fails to edit tt_content records with inline relation added
Updated by S P 21 days ago
- Related to Bug #102625: "showPossibleLocalizationRecords" throws error if editor has no access to default language (Language was not allowed) added