Issue Bug Resolved

#110869Error in permission check for sys_file_references when only one language is available

Johannes Quack 10/01/26, 09:44 updated 10/22/26, 16:10

Description

TYPO3-Version: 14.3.6

I have an extbase entity with a “file” column configured in the TCA.
When an editor tries to add something to this file from the backend, they get the following permission error:

checkRecordEditAccess() check failed [ERROR: The “languageField” field named “sys_language_uid” was not found in testing record!]

The new sys_file_reference record that is submitted to that checkRecordEditAccess() function does not contain a sys_language_uid field, which causes the check in line 746 to fail.

It seems like the field is excluded from the row because showIfEmpty (https://docs.typo3.org/permalink/t3tca:confval-select-single-showifempty) is not set. As soon as I set this value in the TCA the field is added to the backend view (though hidden) and editor can save the record because the field is submitted with the default save action.

Reviews 3

History 24

  1. Oliver Bartsch commented <span data-processor="relativetime" data-value="2026-10-19T19:19:33+00:00" > 10/19/26, 19:19 </span>

    Hey,

    since v14.2 (#109366) FormEngine hides a language field that offers only one language, unless showIfEmpty is set, so the field is not submitted. For a new record, DataHandler then takes the first language the editor may use from the site of the page. If the record is stored on a page or folder outside any site configuration (or on root level), there is no site. The language is then set only when the default values are applied, but the access check checkRecordEditAccess() runs before that. Non-admin editors therefore got an error, e.g. for new file references.

    I created a patch, The access check now uses the language the record will be stored with: the configured default (TCAdefaults or the TCA default) or, without one, the default language 0. The stored record does not change, and editors without access to that language are still rejected. Records on pages inside a site are not affected.

    Could you check that the storage folder of your Extbase records is outside a site configuration, and test the patch? Until then, setting showIfEmpty on the language field remains a valid workaround.

    Best regards,
    Oli

  2. Oliver Bartsch commented and changed status Under Review Resolved done 0 % 100 % <span data-processor="relativetime" data-value="2026-10-22T16:10:10+00:00" > 10/22/26, 16:10 </span>

    Applied in changeset commit:9d202631f3d3fffaf0ddf52d08b3fa6991fb6440.