Bug #81831

sys_refindex and bodytext columns: link reference to files not working

Added by Marcelo Vetter over 2 years ago. Updated about 1 year ago.

Status:
Closed
Priority:
Must have
Assignee:
-
Category:
-
Target version:
Start date:
2017-07-11
Due date:
% Done:

100%

TYPO3 Version:
8
PHP Version:
Tags:
Complexity:
Is Regression:
Sprint Focus:

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.

sys_refindex.png View (28.8 KB) Marcelo Vetter, 2017-07-11 00:13

bodytext.png View (23.4 KB) Marcelo Vetter, 2017-07-11 00:13

sys_refindex.jpg View (45.7 KB) Franz Kugelmann, 2017-09-25 17:54


Related issues

Related to TYPO3 Core - Bug #83377: Soft Reference Index is broken for files Accepted 2017-12-18
Duplicated by TYPO3 Core - Bug #82864: File links in rte_ckeditor don't get counted as a reference Closed 2017-10-26

Associated revisions

Revision e6b9cdea (diff)
Added by Nicole Cordes over 1 year ago

[BUGFIX] Show correct file reference information

This patch corrects how file references (from softrefs) are stored in
sys_refindex table as this was changed with patch
https://review.typo3.org/53219/.

Resolves: #81831
Related: #80991
Related: #80988
Releases: master, 8.7
Change-Id: I776d2db47dffd83217a3c5527860093ddbca58c6
Reviewed-on: https://review.typo3.org/55158
Tested-by: TYPO3com <>
Reviewed-by: Benni Mack <>
Reviewed-by: Joerg Boesche <>
Reviewed-by: Benjamin Kluge <>
Tested-by: Benjamin Kluge <>
Reviewed-by: Stefan Neufeind <>
Reviewed-by: Reiner Teubner <>
Tested-by: Reiner Teubner <>
Reviewed-by: Henning Liebe <>
Tested-by: Henning Liebe <>
Reviewed-by: Sascha Rademacher <>
Tested-by: Sascha Rademacher <>
Reviewed-by: Nicole Cordes <>
Tested-by: Nicole Cordes <>

Revision c57eea6d (diff)
Added by Nicole Cordes over 1 year ago

[BUGFIX] Show correct file reference information

This patch corrects how file references (from softrefs) are stored in
sys_refindex table as this was changed with patch
https://review.typo3.org/53219/.

Resolves: #81831
Related: #80991
Related: #80988
Releases: master, 8.7
Change-Id: I776d2db47dffd83217a3c5527860093ddbca58c6
Reviewed-on: https://review.typo3.org/55431
Tested-by: TYPO3com <>
Reviewed-by: Nicole Cordes <>
Tested-by: Nicole Cordes <>

History

#1 Updated by Marcelo Vetter over 2 years ago


#2 Updated by Marcelo Vetter over 2 years ago

  • 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

#3 Updated by Wolfgang Klinger about 2 years ago

I can confirm that. It works with TYPO3 7.6, but not with current master anymore.

#4 Updated by Franz Kugelmann about 2 years ago

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.

#5 Updated by Franz Kugelmann almost 2 years ago

  • Duplicated by Bug #82864: File links in rte_ckeditor don't get counted as a reference added

#6 Updated by Tania Morales almost 2 years ago

Can you please confirm if there is an update on this issue ?

#7 Updated by Gerrit Code Review almost 2 years ago

  • Status changed from New to Under Review

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/55158

#8 Updated by Gerrit Code Review almost 2 years ago

Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/55158

#9 Updated by Gerrit Code Review almost 2 years ago

Patch set 3 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/55158

#10 Updated by Gerrit Code Review almost 2 years ago

Patch set 4 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/55158

#11 Updated by taywa gmbh almost 2 years ago

  • Related to Bug #83377: Soft Reference Index is broken for files added

#12 Updated by Leonie Philine Bitto almost 2 years ago

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!

#13 Updated by Gerrit Code Review over 1 year ago

Patch set 1 for branch TYPO3_8-7 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/55431

#14 Updated by Nicole Cordes over 1 year ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100

#15 Updated by Benni Mack about 1 year ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF