I experienced a similar issue which might be related:
There is a model with a field for multiple files:
class Proposal extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity {
/**
* Files
*
* @var \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\TYPO3\CMS\Extbase\Domain\Model\FileReference>
*/
protected $files;
...
}
The TCA for this field is:
'files' => array(
'exclude' => 0,
'label' => 'LLL:EXT:cps_proposals/Resources/Private/Language/locallang_db.xlf:tx_cpsproposals_domain_model_proposal.files',
'config' => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getFileFieldTCAConfig('files', array(
'appearance' => array(
'createNewRelationLinkTitle' => 'LLL:EXT:cms/locallang_ttc.xlf:images.addFileReference'
),
// custom configuration for displaying fields in the overlay/reference table
// to use the imageoverlayPalette instead of the basicoverlayPalette
'foreign_match_fields' => array(
'fieldname' => 'files',
'tablenames' => 'tx_cpsproposals_domain_model_proposal',
'table_local' => 'sys_file',
),
'foreign_types' => array(
'0' => array(
'showitem' => '
--palette--;LLL:EXT:lang/locallang_tca.xlf:sys_file_reference.imageoverlayPalette;imageoverlayPalette,
--palette--;;filePalette'
),
\TYPO3\CMS\Core\Resource\File::FILETYPE_TEXT => array(
'showitem' => '
--palette--;LLL:EXT:lang/locallang_tca.xlf:sys_file_reference.imageoverlayPalette;imageoverlayPalette,
--palette--;;filePalette'
),
\TYPO3\CMS\Core\Resource\File::FILETYPE_IMAGE => array(
'showitem' => '
--palette--;LLL:EXT:lang/locallang_tca.xlf:sys_file_reference.imageoverlayPalette;imageoverlayPalette,
--palette--;;filePalette'
),
\TYPO3\CMS\Core\Resource\File::FILETYPE_AUDIO => array(
'showitem' => '
--palette--;LLL:EXT:lang/locallang_tca.xlf:sys_file_reference.imageoverlayPalette;imageoverlayPalette,
--palette--;;filePalette'
),
\TYPO3\CMS\Core\Resource\File::FILETYPE_VIDEO => array(
'showitem' => '
--palette--;LLL:EXT:lang/locallang_tca.xlf:sys_file_reference.imageoverlayPalette;imageoverlayPalette,
--palette--;;filePalette'
),
\TYPO3\CMS\Core\Resource\File::FILETYPE_APPLICATION => array(
'showitem' => '
--palette--;LLL:EXT:lang/locallang_tca.xlf:sys_file_reference.imageoverlayPalette;imageoverlayPalette,
--palette--;;filePalette'
)
)
), $GLOBALS['TYPO3_CONF_VARS']['GFX']['imagefile_ext']),
),
For some instances of this model the list view shows one or more reference uids even though the DB value of this field is 0.
There are records in table sys_file_reference where the field 'foreign_uid' contains the same value as one of this instances but the fields 'tablenames' and 'fieldname' do contain other values, for instance:
uid deleted uid_foreign uid_local tablenames fieldnames ...
41 0 27 13 tt_content image
87 1 411 13 tx_cpspropsals_domain_model_proposal files
The list view shows '41' in field 'files' for the tx_cpsproposals_domain_model_proposal record.
In edit view no reference is shown.
Obviously the contraints defined by the 'matchfields' value in TCA
'foreign_match_fields' => array(
'fieldname' => 'files',
'tablenames' => 'tx_cpsproposals_domain_model_proposal',
'table_local' => 'sys_file',
),
are ignored.
The records are created through the frontend. My implementation uses the upload mechanism from Helmut Hummel (see [1] und [2]).
I debugged the upload process thoroughly and could not detect any flaw.
An update of the reference index did not improve the situation. If the sys_file_reference entry of the other record (tt_content, uid 41 in my example above) is set to deleted=1 the wrong uid disappears from list view.
[1] http://insight.helhum.io/post/85015526410/file-upload-using-extbase-and-fal-in-typo3-6-2
[2] https://github.com/helhum/upload_example/blob/master/Classes/Property/TypeConverter/UploadedFileReferenceConverter.php
Cheers Dirk