Project

General

Profile

Actions

Bug #51663

closed

Render extended fields of sys_file_reference

Added by Markus Hölzle about 11 years ago. Updated over 10 years ago.

Status:
Closed
Priority:
Won't have this time
Assignee:
-
Category:
File Abstraction Layer (FAL)
Target version:
-
Start date:
2013-09-03
Due date:
% Done:

0%

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

Description

There is a bug if you want to extend the sys_file_reference table. The new fields are not accessible via typoscript!
The bug is in the \TYPO3\CMS\Core\Resource\Service\FrontendContentAdapterService where only specific fields are handled.

The lines in the static function modifyDBRow:

foreach ($files as $file) {
    $fileProperties = $file->getProperties();
    $fileFieldContents['paths'][] = '../../' . $file->getPublicUrl();
    $fileFieldContents['titleTexts'][] = $fileProperties['title'];
    $fileFieldContents['captions'][] = $fileProperties['description'];
    $fileFieldContents['links'][] = $fileProperties['link'];
    $fileFieldContents['alternativeTexts'][] = $fileProperties['alternative'];
    $fileFieldContents[$migrateFieldName .  '_fileUids'][] = $file->getOriginalFile()->getUid();
}

I changed to

foreach ($files as $file) {
    $fileProperties = $file->getProperties();
    $fileFieldContents['paths'][] = '../../' . $file->getPublicUrl();
    $fileFieldContents['titleTexts'][] = $fileProperties['title'];
    $fileFieldContents['captions'][] = $fileProperties['description'];
    $fileFieldContents['links'][] = $fileProperties['link'];
    $fileFieldContents['alternativeTexts'][] = $fileProperties['alternative'];
    $fileFieldContents[$migrateFieldName .  '_fileUids'][] = $file->getOriginalFile()->getUid();

    $filePropertiesBlacklist = array('uid','pid','tstamp','crdate','cruser_id','sorting','deleted',
        'hidden','t3ver_oid','t3ver_id','t3ver_wsid','t3ver_label','t3ver_state','t3ver_stage',
        't3ver_count','t3ver_tstamp','t3ver_move_id','t3_origuid','sys_language_uid','title',
        'description','link','alternative');
    foreach($fileProperties AS $key => $value) {
        if(!in_array($key,$filePropertiesBlacklist)) {
            $fileFieldContents[$key][] = $value;
            $oldFieldNames[$key] = $key;
        }
    }
}

Actions

Also available in: Atom PDF