Project

General

Profile

Actions

Bug #48883

closed

Wrong sys_language_uid in sys_file_reference

Added by Heiko Kromm over 11 years ago. Updated about 6 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Extbase
Target version:
-
Start date:
2013-06-05
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
6.1
PHP Version:
5.4
Tags:
Complexity:
Is Regression:
No
Sprint Focus:

Description

I have a domain model, which has a property image, which is a FAL image.
When I create a new element in default language and add a FAL image to this element everything works fine.
If I localize the element the FAL ImageResource will be localized too.

But if I create a new element in non-default language (sys_language_uid = 1) the attached FAL image is not recognized by extbase.
I checked the sys_file_reference table and the entry for the attached FAL image has a sys_language_uid=0. Therefore extbase does not recognize the FAL image. If I change sys_language_uid to 1, which is the sys_language_uid of the parent object ist works.

I think when creating new inline FAL images, the system needs to respect the sys_language_uid of the parent Object.


Related issues 8 (1 open7 closed)

Related to TYPO3 Core - Bug #57272: Extbase doesn't handle FAL translations correctlyClosed2014-03-25

Actions
Related to TYPO3 Core - Bug #57063: Parent language is not applied to new child recordsClosed2014-03-19

Actions
Related to TYPO3 Core - Bug #75040: placeholder pointing to column of related record shows values from wrong languageClosed2016-03-14

Actions
Related to TYPO3 Core - Bug #63092: Inline/IRRE records: language field of child records is not updated when modifying parent language field - e.g. problematic for sys_file_referenceRejectedJo Hasenau2014-11-20

Actions
Related to TYPO3 Core - Bug #76048: IRRE: Child records - New record doesn't get language of parent (non localized records but using new button)ClosedJo Hasenau2016-05-04

Actions
Related to TYPO3 Core - Bug #59734: Translating a CE containing inline elements doesn't apply language to inline elementsUnder Review2014-06-20

Actions
Related to TYPO3 Core - Bug #82330: cant create inline records if ctrl > enablecolumns > endtime is not specified in childrens TCA Closed2017-09-07

Actions
Blocked by TYPO3 Core - Bug #21964: New child records created from a translated record have default languageClosed2010-01-15

Actions
Actions #1

Updated by Tim Lochmüller over 11 years ago

I can confirm this issue. But I think it is more an IRRE Bug than a FAL related issue?!

Actions #2

Updated by Aske Ertmann about 11 years ago

Looking a little into this issue I think the reason why it doesn't work in Extbase is because the FAL API doesn't use proper TYPO3 API to get file references. I looks like it would work fine if you use the TypoScript objects to fetch your references because the ContentObjectRenderer's getImgResource uses FAL's ResourceFactory to fetch the file reference. The method getFileReferenceObject in the ResourceFactory uses the page repository's checkRecord method, which does not check language and therefore bypassing the language field. However Extbase uses the it's own SQL parser which follows all the rules defined in the sys_file_reference's ctrl configuration, and therefore adds the language check.

http://api.typo3.org/typo3cms/master/html/_resource_factory_8php_source.html#l00440

So IMO it's related to FAL since FAL bypasses the ctrl configuration, but there are of course more than one solution, either one specifically for Extbase and one for handling languages for sys_file_references property. Thing is though that the references are copied when an element is translated instead of it using the normal inline translation workflow, so maybe it doesn't even make sense to have localized versions of sys_file_references.

Actions #3

Updated by Frans Saris almost 11 years ago

  • Is Regression set to No

IMO it is a problem in IRRE as the FAL layer isn't touched when you create a new relation in BE.

Actions #4

Updated by Viktor Livakivskyi over 10 years ago

Added a dependency to an IRRE issue #21964, which is... 4 years old.

Actions #5

Updated by Jan Greth over 10 years ago

I have the exact same behaviour and brings much trouble in multilingual sites...
Does anyone have a clue how to workaround this?

Actions #6

Updated by Helmut Hummel over 10 years ago

  • Status changed from New to Needs Feedback

Can you please check if this issue is fixed for you with the fix applied to #57063

Actions #7

Updated by Patrick Kroog over 10 years ago

I can confirm that this issue still exists in 6.2.3 (unfortunately can't try out 6.2.4 atm)

1) Create new Parent Record (set sys_language_uid > 0)
2) Create Image-IRRE-Relation (sys_file_reference) -> sys_language_uid field is in hidden palette "filePalette" and of course defaults to value "0" (if no other default value is set)

3) Result: Parent Record has sys_language_uid > 0.. Child Record in sys_file_reference has the value "0" as you can't change it by default...

The problem also still seems to exist for already existing parent records.

@Jan Schröder Greth:
For now, one option is to make the palette visible via extTables.php, and then at least be able to configure the sys_language_uid field manually:

$TCA['sys_file_reference']['palettes']['filePalette']['isHiddenPalette'] = 0;

Actions #8

Updated by Alexander Opitz about 10 years ago

  • Status changed from Needs Feedback to New
Actions #9

Updated by Mathias Schreiber over 8 years ago

  • Category changed from File Abstraction Layer (FAL) to Extbase
Actions #10

Updated by Tymoteusz Motylewski almost 8 years ago

But if I create a new element in non-default language (sys_language_uid = 1) the attached FAL image is not recognized by extbase.

Do you create a new record through extbase or backend?
Can you provide a simple test extension and describe steps to reproduce it?

Actions #11

Updated by Gerrit Code Review over 7 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/52061

Actions #12

Updated by Nicole Cordes over 7 years ago

Steps how to reproduce:

- create a page_language_overall for a page
- insert a new content element "text & media"

case 1:
- save the content element
- add an image to media tab (assets field)
- save the content record again

expectation:
- sys_file_reference record is stored with proper language in sys_language_uid

actual:
- sys_file_reference record is stored with sys_language_uid 0

case 2:
- add an image to media tab (without saving the parent content record)
- save the content record

expectation:
- sys_file_reference record is stored with proper language in sys_language_uid

actual:
- sys_file_reference record is stored with sys_language_uid 0

Actions #13

Updated by Gerrit Code Review over 7 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/52061

Actions #14

Updated by Gerrit Code Review over 7 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/52061

Actions #15

Updated by Gerrit Code Review over 7 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/52061

Actions #16

Updated by Gerrit Code Review over 7 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/52061

Actions #17

Updated by Gerrit Code Review over 7 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/52061

Actions #18

Updated by Gerrit Code Review over 7 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/52061

Actions #19

Updated by Gerrit Code Review over 7 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/52061

Actions #20

Updated by Gerrit Code Review over 7 years ago

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

Actions #21

Updated by Gerrit Code Review over 7 years ago

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

Actions #22

Updated by Nicole Cordes over 7 years ago

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

Updated by Gerrit Code Review over 7 years ago

  • Status changed from Resolved 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/52148

Actions #24

Updated by Nicole Cordes over 7 years ago

  • Status changed from Under Review to Resolved
Actions #25

Updated by Gerrit Code Review over 7 years ago

  • Status changed from Resolved to Under Review

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

Actions #26

Updated by Gerrit Code Review over 7 years ago

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

Actions #27

Updated by Gerrit Code Review over 7 years ago

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

Actions #28

Updated by Gerrit Code Review over 7 years ago

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

Actions #29

Updated by Gerrit Code Review over 7 years ago

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

Actions #30

Updated by Gerrit Code Review over 7 years ago

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

Actions #31

Updated by Anonymous over 7 years ago

  • Status changed from Under Review to Resolved
Actions #32

Updated by Tymoteusz Motylewski over 7 years ago

The backport to v7 has been merged (https://review.typo3.org/#/c/53206/)
Few notes:
1) Now NEW irre elements (including FAL relations) will get a sys_language_uid of their parent.
2) There is no automatic migration of the old record having inccorrect value in the sys_language_uid.
3) The issue has been solved on the FormEngine level, thus you need to make sure you have
sys_language_uid field in the showitem list in your TCA.

Often you don't want to show the sys_language field to the user, so there is a little trick, which will make stuff work without showing the field to the user.
You just need to create a hidden palette with sys_language_uid in it.
e.g.

'showitem' = '... --palette--;;hiddenLanguagePalette,';
'hiddenLanguagePalette' => [
    'showitem' => 'sys_language_uid, l10n_parent',
         'isHiddenPalette' => true,
],

See TCA for sys_file_reference where this approach is used, or this pull request as a reference https://github.com/benjaminkott/bootstrap_package/pull/458

Actions #33

Updated by Mathias Brodala about 7 years ago

  • Related to Bug #82330: cant create inline records if ctrl > enablecolumns > endtime is not specified in childrens TCA added
Actions #34

Updated by Benni Mack about 6 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF