Bug #48883
closedWrong sys_language_uid in sys_file_reference
Added by Heiko Kromm over 11 years ago. Updated about 6 years ago.
100%
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.
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?!
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.
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.
Updated by Viktor Livakivskyi over 10 years ago
Added a dependency to an IRRE issue #21964, which is... 4 years old.
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?
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
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;
Updated by Alexander Opitz about 10 years ago
- Status changed from Needs Feedback to New
Updated by Mathias Schreiber almost 9 years ago
- Category changed from File Abstraction Layer (FAL) to Extbase
Updated by Tymoteusz Motylewski about 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?
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
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
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
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
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
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
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
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
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
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
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
Updated by Nicole Cordes over 7 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset c4c2ae465ad11d7692d2c04e953f188f80b2bf35.
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
Updated by Nicole Cordes over 7 years ago
- Status changed from Under Review to Resolved
Applied in changeset d9e9992259fe665932e6ba26954e52b4ceedeb7d.
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
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
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
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
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
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
Updated by Anonymous over 7 years ago
- Status changed from Under Review to Resolved
Applied in changeset 9d3aa8618be9366f7b2457cdddc586cd6491dcea.
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
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