Project

General

Profile

Actions

Bug #64881

open

Filelist with a collaction and translated metadata not working properly

Added by Cornel Widmer almost 10 years ago. Updated over 4 years ago.

Status:
Under Review
Priority:
Must have
Assignee:
-
Category:
File Abstraction Layer (FAL)
Start date:
2015-02-05
Due date:
% Done:

0%

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

Description

We started to make categories to build up a download repository. Every file in the filelist gets a category and a translation to display proper filenames. But it seems the handling of the filelist in the frontend is wrong when it comes to categories.

I'll try to explain this in two cases...

CASE 1
Backend
File A (Default Language (German)) gets the category "Kategorie 1"
File A (English) gets the category "Kategorie 1"
Frontend
Two downloads are visible in german and also in english.

CASE 2
Backend
File A (Default Language (German)) gets the category "Kategorie 1"
File A (English) gets no category
Frontend
One download is visible in german and also in english.

Problem
We have no possibility to hide some files in a specific language. But most in the time you'll have a file with informations in German (File A) and one in English (File B). And you want to display this only on the website in the specific language.
In this case I would do this:
Assign "Kategorie 1" to File A (Default Language (German)) and remove the category assigment on the translated record.
Assign "Kategorie 1" to File b (English) and remove the category assigment on the default language record.

Not finally tested solution (quick and dirty fix)
In this case we collected the files with the categories trough FAL collactions. So I've modified this lines of code in the file "CategoryBasedFileCollection.php" (typo3/sysext/core/Classes/Resource/Collection/CategoryBasedFileCollection.php)
$resource = $this->getDatabaseConnection()->exec_SELECT_mm_query(
'sys_file_metadata.file',
'sys_category',
'sys_category_record_mm',
'sys_file_metadata',
'AND sys_file_metadata.sys_language_uid IN ('.$GLOBALS['TSFE']->sys_language_uid.', -1) AND sys_category.uid=' . (int)$this->getItemsCriteria() .
' AND sys_category_record_mm.tablenames = \'sys_file_metadata\''
);

This is some kind of quick and dirty fix and not finally tested. But maybe this informations are enought to start a discussion about how filelinks should be handled on translated pages.


Files

case1.jpg (105 KB) case1.jpg Cornel Widmer, 2015-02-05 17:03
case2.jpg (103 KB) case2.jpg Cornel Widmer, 2015-02-05 17:03
Actions

Also available in: Atom PDF