File links in RTE don't get counted as a reference since TYPO3 6.2.11
After the update from TYPO3 6.2.10 to 6.2.11 the file links set in the RTE don't get counted as a reference correctly anymore.
Steps to reproduce:
1) Insert a link to a file in a text element (RTE)
2) Check the number of references for this file in the filelist-module
3) The number should get increased, but it doesn't
After going back to 6.2.10 the number of references gets updated correctly again.
Updated by Markus Klein over 5 years ago
The reported bug here will be solved by reverting the first hunk in
- if a link wizard is attached
- if a softref parser is defined
For the header_link field currently both options apply, which causes the field to be parsed twice.
There are some other (old) fields in the compatibility6 sysext, which have the same TCA setting as header_link, but pass an additional option to the typolink-softref-parser, named linkList (that is support for multiple links in a single field).
The wizard link FAL handling was introduced with https://review.typo3.org/#/c/10655/2/t3lib/class.t3lib_refindex.php (2012-04-20)
The softref FAL handling was introduced with https://review.typo3.org/#/c/10942/7/typo3/sysext/core/Classes/Database/SoftReferenceIndex.php (2013-03-22)
So the second change actually caused this duplicate indexing, as the softref-definition of the header_link fields is there since the initial commit!
A possible solution would be to drop the softref-configuration on the header_link field, but that keeps the problem for the old fields, which need special treatment (linkList) through the softref-parser. So this is not a clean solution.
Another option would be to add a condition to the first code part and only run the parser if a link wizard is present but no softref-parser. (This will probably work, but is not nice code-wise as we couple two different classes via their configuration.)
Dropping the parsing for link wizards completely would be the best solution, leaving the magic to the softref-parser, since those fields are actually soft-refs and no real db-refs.
IMHO the original patch introducing this is just plain wrong about that code.
Updated by Nicole Cordes over 5 years ago
IMHO removing the parsing for link wizard would be a bad idea. This means that every extension using the link wizard without specifying the field to have soft references wouldn't have any file association anymore. I would still opt to add references for db type if no softref is defined in field configuration.