Project

General

Profile

Actions

Bug #83377

closed

Soft Reference Index is broken for files

Added by Sascha Egerer almost 7 years ago. Updated almost 5 years ago.

Status:
Closed
Priority:
Must have
Assignee:
-
Category:
DataHandler aka TCEmain
Target version:
-
Start date:
2017-12-18
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
8
PHP Version:
Tags:
Complexity:
medium
Is Regression:
Sprint Focus:

Description

The reference index build for files via the soft reference indexer is broken.
The reference index entry is created with type _FILE and the ref_string is filled up with the uid of the sys_file record.

How to reproduce:
  1. Create a Text Media Content element
  2. Add a text and link it to a file
  3. Run cleanup:missingfiels
    vendor/bin/typo3 cleanup:missingfiles --update-refindex
    
    Find all file references from records pointing to a missing (non-existing) file.
    ================================================================================
    
     ! [NOTE] Finding missing files referenced by TYPO3 requires a clean reference index (sys_refindex)                     
    
     ! [NOTE] Found 1 soft-referenced files that need manual repair.                                                        
    
     * 108 - f9165d6906bdd2e6a6ea39f3f05a6957 - tt_content:9:bodytext::typolink_tag
    
    *******************************************
    Reference Index being Updated
    *******************************************
    3258 records from 102 tables were checked/updated.
    Index Integrity was perfect!
    

The reference index will always be broken as the indexer tries to resolve the file path (ref_string) which is the id. So the missingfiles task will always report an error as it tries to find file is_file(PATH_site . 108).

IMO the whole _FILE stuff can be dropped from the reference index as there is only FAL from version 8. So all reference index stuff could be build based on database records. Removing all the _FILE stuff will end up in normal databse relation checks which give the expected result as a file is internally also a database record (sys_file). Storing the file path and checking if that path is available does not really makes sense IMO if using a file abstraction layer.

Another option would be so create the refindex the same way as a native field does it.
If a link is created in a native link field (no soft ref index) the entry is created as type "_STRING" and the "ref_string" contains the "typolink".

hash                                    tablename    recuid  field           flexpointer     softref_key     softref_id                          sorting    deleted    workspace    ref_table    ref_uid    ref_string
81fbe3b5f0f7195cbd7f27fea2c992c9        tt_content   9       header_link                     typolink        42d061dbe8503a03e71e5e002ed94c3a:0  -1         0          0            _STRING      0          t3://file?uid=108
f9165d6906bdd2e6a6ea39f3f05a6957        tt_content   9       bodytext                        typolink_tag    9                                   -1         0          0            _FILE        0          108

Files

no_ref_deletable.png (32.8 KB) no_ref_deletable.png taywa gmbh, 2018-01-03 17:25
reference_info_asset.png (51.4 KB) reference_info_asset.png taywa gmbh, 2018-01-03 17:34

Related issues 2 (0 open2 closed)

Related to TYPO3 Core - Bug #81831: sys_refindex and bodytext columns: link reference to files not workingClosed2017-07-11

Actions
Related to TYPO3 Core - Bug #84016: impexp: page links are parsed / replaced incorrectely due to error in SoftReferenceIndexClosed2018-02-22

Actions
Actions

Also available in: Atom PDF