Bug #81831
closed
sys_refindex and bodytext columns: link reference to files not working
Added by Marcelo Vetter over 7 years ago.
Updated about 6 years ago.
Description
It seems that references in the Filelist for files referenced in any bodytext column are not working anymore in typo3 8.7.x. I even tried with the latest release 8.7.3.
I attached an image that you can see the PDF file-example.pdf has no Ref although the file is linked in a text element (in a bodytext field). It used to show the number of times it was referenced.
I tried in a clean installation and it also doesn't work, so I think this a bug. This was helpful to know if the file is being linked anywhere in the website.
Files
- Subject changed from sys_refindex and bodytext columns: link reference to files when linking a file in a text element is not working to sys_refindex and bodytext columns: link reference to files not working
I can confirm that. It works with TYPO3 7.6, but not with current master anymore.
I can confirm, too. The reason is that the code for creating the Link to the references in FileList::makeRef is checking only for entries in sys_refindex with ref_table='sys_file'. Since 8 however, for links in bodytext and i.e. header field to files from filelist there are new keywords "_FILE" and "_STRING" introduced. You can easily check this by truncating table sys_refindex and creating such file references in an textmedia content element.
I guess the code in FileList::makeRef needs to be adapted to take also "_FILE" and "_STRING" into account. Not sure about side effects or if such references would correctly be shown however.
- Has duplicate Bug #82864: File links in rte_ckeditor don't get counted as a reference added
Can you please confirm if there is an update on this issue ?
- Status changed from New to Under Review
- Related to Bug #83377: Soft Reference Index is broken for files added
I can also confirm this bug.
The sys_refindex contains entries with ref_table="_FILE"
, ref_uid
ALWAYS = 0
and ref_string
being the sys_file uid
.
\TYPO3\CMS\Filelist\FileList::makeRef()
only counts entries with ref_table="sys_file"
and ref_uid
being the sys_file uid
- instead of ref_string
.
The CURRENTLY correct (but indeed broken) way (watch out - here we have duplicated code!) is implemented here:
\TYPO3\CMS\Backend\Utility\BackendUtility::referenceCount()
. As a workaround, \TYPO3\CMS\Filelist\FileList::makeRef() could make use of this @BackendUtility
method.
(Still must be used with parameter $table='_FILE'
- then ref_string is used rather than ref_uid
for file (soft)reference count.)
Of course it would be more correct to use sys_file
database relations instead of the _FILE
hack with sys_file uids
being stored in ref_string
.
I hope that https://review.typo3.org/#/c/55158/ lands soon!
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
- Status changed from Resolved to Closed
- Related to Bug #86628: Linked files not referenced in backend filelist added
Also available in: Atom
PDF