[BUGFIX] Fix language of placeholder for relations 88/54888/2
authorNicole Cordes <typo3@cordes.co>
Wed, 22 Nov 2017 11:28:37 +0000 (12:28 +0100)
committerAndreas Wolf <andreas.wolf@typo3.org>
Thu, 30 Nov 2017 14:24:07 +0000 (15:24 +0100)
commit5b4e54a7b26b6b693e89cdf2d3669686a9ffa9ed
treeea3536da0b71d5885bce0097e48f8ef0c0e9086a
parent87f676546616bd84fa25a8cc94b9d11431d49773
[BUGFIX] Fix language of placeholder for relations

When a parent record (e.g. tt_content) has inline relations
(e.g. sys_file_reference)and these relations show a placeholder
for records related to them (e.g. sys_file and sys_file_metadata)
then we need to pass the context of the language so that
the placeholders are shown in the correct language.

We now do so by putting the value of the language field
of the parent record into the data set and update it
in case child records are also translatable.

This way when going down the list of children, we always
know the language id of the last applicable parent element,
even if one element in between was not translatable (e.g. sys_file)

If we know the language, we can pick the correct record uid
out of the list of possible related uids, instead of
just picking the first one.

Furthermore the language field for sys_file_metadata is removed from
editor form as the language is set by GET parameter already.

Change-Id: I64c97c8080196599e85b95e09e7eb89701670fa4
Resolves: #75040
Releases: master, 8.7
Reviewed-on: https://review.typo3.org/54831
Reviewed-by: Nicole Cordes <typo3@cordes.co>
Tested-by: Nicole Cordes <typo3@cordes.co>
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Andreas Wolf <andreas.wolf@typo3.org>
Tested-by: Andreas Wolf <andreas.wolf@typo3.org>
Reviewed-on: https://review.typo3.org/54888
typo3/sysext/backend/Classes/Form/FormDataProvider/TcaInputPlaceholders.php
typo3/sysext/core/Configuration/TCA/sys_file_metadata.php
typo3/sysext/filemetadata/Tests/Functional/Tca/FileMetadataVisibleFieldsTest.php