Issue Bug Closed

#51663Render extended fields of sys_file_reference

Markus Hölzle 09/03/13, 10:17 updated 03/19/14, 09:16

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;
        }
    }
}

Reviews 0

No change resolves or names this issue in its commit message, and no comment links one.