Bug #75040

placeholder pointing to column of related record shows values from wrong language

Added by Philipp Wrann over 3 years ago. Updated about 1 year ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
FormEngine aka TCEforms
Target version:
Start date:
2016-03-14
Due date:
% Done:

100%

TYPO3 Version:
7
PHP Version:
Tags:
Complexity:
Is Regression:
No
Sprint Focus:

Description

Hope this is not a duplicte.

If i create a file Reference on default language it happens that the placeholder is calculated from some translation.

In my case i added a media-field and handle inline relations to sys_file_reference records. When i edit the default language the meta title|alternative of the first translation record is shown.

The data is saved correctly, so the aggregate and the sys_file_reference both have sys_language_uid set to 0 - but still the wrong metadata is used as placeholder.

The language setting should be taken into account there.


Related issues

Related to TYPO3 Core - Bug #76048: IRRE: Child records - New record doesn't get language of parent (non localized records but using new button) Closed 2016-05-04
Related to TYPO3 Core - Bug #48883: Wrong sys_language_uid in sys_file_reference Closed 2013-06-05
Related to TYPO3 Core - Bug #85711: File language field is rendered twice and sys_language_uid is never rendered in sys_file_metadata Closed 2018-08-01
Duplicated by TYPO3 Core - Bug #78395: SysFileReference shows localized metadata for default language Closed 2016-10-24
Duplicated by TYPO3 Core - Bug #78897: file references consider wrong language uid for metadata Closed 2016-12-06
Duplicated by TYPO3 Core - Bug #82193: FAL relation: Default file meta data values shown in wrong language Closed 2017-08-24
Duplicated by TYPO3 Core - Bug #83150: Sys_file_reference in default language showing metadata of translation Closed 2017-11-29

Associated revisions

Revision 5be3ec13 (diff)
Added by Nicole Cordes about 2 years ago

[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 last one.

Resolves: #75040
Releases: master, 8.7
Change-Id: Iff1b5350138d3043df470d2bdbdfebc83ec8cc5a
Reviewed-on: https://review.typo3.org/54722
Tested-by: TYPO3com <>
Reviewed-by: Susanne Moog <>
Tested-by: Susanne Moog <>
Reviewed-by: Christian Kuhn <>
Tested-by: Christian Kuhn <>

Revision 01465531 (diff)
Added by Nicole Cordes about 2 years ago

[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 <>
Tested-by: Nicole Cordes <>
Tested-by: TYPO3com <>
Reviewed-by: Andreas Wolf <>
Tested-by: Andreas Wolf <>

Revision 5b4e54a7 (diff)
Added by Nicole Cordes about 2 years ago

[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

Revision 2f3577d7 (diff)
Added by Helmut Hummel over 1 year ago

[BUGFIX] Correctly render language fields of sys_file_metadata

This reverts commit 1a74c8c9d302958dd17b6a35c03e185f13811c4b
("[BUGFIX] Correctly reference sys_file_metadata.language in TCA"),
that replaced the rendering of sys_language_uid and l10n_parent
with the file language field, which was since then rendered twice.

We now correctly render the hidden language palette in the general tab
and remove the language tab, which was empty after the palette has been
hidden.

Resolves: #85711
Related: #84200
Related: #75040
Releases: master, 8.7
Change-Id: I18ab907bc48f81b257d3af42c4278d6688166b2f
Reviewed-on: https://review.typo3.org/57760
Reviewed-by: Moritz Ngo <>
Tested-by: Moritz Ngo <>
Reviewed-by: Dennis Oezet <>
Tested-by: Dennis Oezet <>
Tested-by: TYPO3com <>
Reviewed-by: Markus Volkmer <>
Tested-by: Markus Volkmer <>
Reviewed-by: Nicole Cordes <>
Tested-by: Nicole Cordes <>

Revision 3712c7cb (diff)
Added by Nicole Cordes over 1 year ago

[BUGFIX] Correctly render language fields of sys_file_metadata

This reverts commit 1a74c8c9d302958dd17b6a35c03e185f13811c4b
("[BUGFIX] Correctly reference sys_file_metadata.language in TCA"),
that replaced the rendering of sys_language_uid and l10n_parent
with the file language field, which was since then rendered twice.

We now correctly render the hidden language palette in the general tab
and remove the language tab, which was empty after the palette has been
hidden.

Resolves: #85711
Related: #84200
Related: #75040
Releases: master, 8.7
Change-Id: I18ab907bc48f81b257d3af42c4278d6688166b2f
Reviewed-on: https://review.typo3.org/57761
Reviewed-by: Helmut Hummel <>
Tested-by: Helmut Hummel <>
Reviewed-by: Markus Volkmer <>
Tested-by: Markus Volkmer <>
Reviewed-by: Moritz Ngo <>
Tested-by: Moritz Ngo <>
Reviewed-by: Dennis Oezet <>
Tested-by: Dennis Oezet <>
Tested-by: TYPO3com <>

History

#1 Updated by Florian Baumann over 3 years ago

I can confirm this. It always takes the last created translation of the record.

In FE, the correct translation is taken for the rendering.

#2 Updated by Peter Linzenkirchner over 3 years ago

I can confirm it for the current dev (8.1.0-dev).

#3 Updated by Jeffrey Nellissen over 3 years ago

I also can confirm this bug in the current stable version 7.6.9. It is really confusing for our editors and it is not only happened in the default language. The placeholder for the title, caption,... will always taken his content from the last created language version of a sys_file, not from the choosen sys_language. Like Florian wrote, in FE it works like a charm.

#4 Updated by Andreas Wolf over 3 years ago

  • Status changed from New to Accepted

I can also confirm this. My use case was a relation to sys_file, which resolves the placeholders from sys_file_metadata. The problem here is that the sys_language_uid is not available when resolving the records, which happens in TcaInline::resolveRelatedRecords(). Therefore, a list of the sys_file_metadata records for all languages is fetched, from which one is semi-randomly chosen (it always uses the first one returned).

My idea for a fix is to add the language to use to $result, which then needs to pass it on. In general, it would be good to pass on this context in a more robust way, both here and in DataHandler.

#5 Updated by Tymoteusz Motylewski about 3 years ago

can somebody provide a test extension to ease reproducing and fixing the issue?
is the https://forge.typo3.org/issues/78395 a duplicate?

#6 Updated by Florian Baumann about 3 years ago

There is no need for an extension to reproduce that.

Do the following on an instance with more than one language installed:

1) Add a new file to the FAL
2) Add the file's FAL record translations (fill in the title) for all the available languages
3) Add a new text & media content element and import the newly created file there
4) Take a look at the title field. You will notice the last created translation of the file as a default placeholder there

I just tested this on a TYPO3 7.6.12. The issue still persists.

#7 Updated by Tymoteusz Motylewski about 3 years ago

Hi Florian
in the step 2) you're referring to translating the file in th filelist module?

#8 Updated by Tymoteusz Motylewski about 3 years ago

I've managed to reproduce it. The issue is similar to #76048 - we lack the language context in there too.

#9 Updated by Thomas Deinhamer over 2 years ago

Happens also in TYPO3 8.4

#10 Updated by Helmut Hummel over 2 years ago

  • Related to deleted (Bug #78897: file references consider wrong language uid for metadata)

#11 Updated by Helmut Hummel over 2 years ago

  • Duplicated by Bug #78897: file references consider wrong language uid for metadata added

#12 Updated by Gerrit Code Review over 2 years ago

  • Status changed from Accepted to Under Review

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/53483

#13 Updated by Gerrit Code Review over 2 years ago

Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/53483

#14 Updated by Gerrit Code Review over 2 years ago

Patch set 3 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/53483

#15 Updated by Gerrit Code Review about 2 years ago

Patch set 4 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/53483

#16 Updated by Gerrit Code Review about 2 years ago

Patch set 5 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/53483

#17 Updated by Gerrit Code Review about 2 years ago

Patch set 6 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/53483

#18 Updated by Gerrit Code Review about 2 years ago

Patch set 7 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/53483

#19 Updated by Christian Kuhn about 2 years ago

  • Duplicated by Bug #82193: FAL relation: Default file meta data values shown in wrong language added

#20 Updated by Gerrit Code Review about 2 years ago

Patch set 1 for branch TYPO3_8-7 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/54686

#21 Updated by Gerrit Code Review about 2 years ago

Patch set 2 for branch TYPO3_8-7 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/54686

#22 Updated by Gerrit Code Review about 2 years ago

Patch set 3 for branch TYPO3_8-7 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/54686

#23 Updated by Gerrit Code Review about 2 years ago

Patch set 4 for branch TYPO3_8-7 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/54686

#24 Updated by Gerrit Code Review about 2 years ago

Patch set 5 for branch TYPO3_8-7 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/54686

#25 Updated by Gerrit Code Review about 2 years ago

Patch set 6 for branch TYPO3_8-7 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/54686

#26 Updated by Gerrit Code Review about 2 years ago

Patch set 7 for branch TYPO3_8-7 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/54686

#27 Updated by Gerrit Code Review about 2 years ago

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/54722

#28 Updated by Gerrit Code Review about 2 years ago

Patch set 8 for branch TYPO3_8-7 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/54686

#29 Updated by Gerrit Code Review about 2 years ago

Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/54722

#30 Updated by Nicole Cordes about 2 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100

#31 Updated by Markus Klein about 2 years ago

  • Status changed from Resolved to New

#32 Updated by Markus Klein about 2 years ago

  • % Done changed from 100 to 0

master patch had to be reverted

#33 Updated by Gerrit Code Review about 2 years ago

  • Status changed from New to Under Review

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/54831

#34 Updated by Gerrit Code Review about 2 years ago

Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/54831

#35 Updated by Christian Kuhn about 2 years ago

  • Duplicated by Bug #83150: Sys_file_reference in default language showing metadata of translation added

#36 Updated by Gerrit Code Review about 2 years ago

Patch set 3 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/54831

#37 Updated by Gerrit Code Review about 2 years ago

Patch set 4 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/54831

#38 Updated by Gerrit Code Review about 2 years ago

Patch set 5 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/54831

#39 Updated by Gerrit Code Review about 2 years ago

Patch set 6 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/54831

#40 Updated by Gerrit Code Review about 2 years ago

Patch set 7 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/54831

#41 Updated by Gerrit Code Review about 2 years ago

Patch set 8 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/54831

#42 Updated by Nicole Cordes about 2 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100

#43 Updated by Gerrit Code Review about 2 years ago

  • Status changed from Resolved to Under Review

Patch set 1 for branch TYPO3_8-7 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/54888

#44 Updated by Nicole Cordes about 2 years ago

  • Status changed from Under Review to Resolved

#45 Updated by Helmut Hummel over 1 year ago

  • Related to Bug #85711: File language field is rendered twice and sys_language_uid is never rendered in sys_file_metadata added

#46 Updated by Benni Mack about 1 year ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF