Project

General

Profile

Actions

Bug #95380

closed

ReferenceIndex does not take LinkHandler Configuration into account

Added by Franz Kugelmann over 2 years ago. Updated over 1 year ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Backend API
Target version:
Start date:
2021-09-28
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
10
PHP Version:
7.4
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

When using the linkhandler to configure links to single records like explained in https://docs.typo3.org/m/typo3/reference-coreapi/10.4/en-us/ApiOverview/LinkBrowser/Linkhandler/Index.html, the resulting entries in sys_refindex are broken. As a result the references are not show correctly and running the command cleanup:missingrelations results in an exception like

 [ Doctrine\DBAL\Exception\TableNotFoundException ]                                                          
  An exception occurred while executing 'SELECT `uid`, `pid` FROM `news` WHERE `uid` = ?' with params [587]:  

  Table 'db.news' doesn't exist

How to reproduce (in v10 and v11 - probably also v9):

Add LinkHandler configuration like

TCEMAIN.linkHandler {
    news {
        handler = TYPO3\CMS\Recordlist\LinkHandler\RecordLinkHandler
        label = News
        configuration {
            table = tx_news_domain_model_news
            storagePid = 0
            pageTreeMountPoints = 0
            hidePageTree = 0
        }
        scanAfter = page
        displayAfter = page
    }
}

Create a link in tt_content::header_link to a record (in this case News), this will result in something like
t3://record?identifier=news&uid=599

You can also just copy the above link into the header_link field. It does not matter which record is linked.
The issue is that the ReferenceIndex row is just filled with the identifier (here "news") in field sys_refindex::ref_table. But it must be the real tablename (here "tx_news_domain_model_news") given in the linkhandler configuration.
Note:
LinkHandler-Links in RTE fields do not create entries in sys_refindex, you have to create the link in field header_link to reproduce the issue

Actions

Also available in: Atom PDF