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 #1

Updated by Stefan Galinski almost 11 years ago

  • Category set to File Abstraction Layer (FAL)
  • Is Regression set to No
Actions #2

Updated by Steffen Ritter almost 11 years ago

  • Status changed from New to Needs Feedback
  • Priority changed from Must have to Won't have this time

Hi,
the fields should be merged to TYPO3 - they are accessible as normal properties on the file, nevertheless the migration you mentioned only is for legacy purposes.

Actions #3

Updated by Alexander Opitz over 10 years ago

  • Status changed from Needs Feedback to Closed

No feedback within the last 90 days => closing this ticket.

If you think that this is the wrong decision or experience this issue again, then please write to the mailing list typo3.teams.bugs with issue number and an explanation or open a new ticket and add a relation to this ticket number.

Actions

Also available in: Atom PDF