Project

General

Profile

Actions

Bug #100934

open

Typolink soft reference parsers does not consider links to currrent page

Added by Sybille Peters 12 months ago. Updated 9 months ago.

Status:
Under Review
Priority:
Should have
Assignee:
-
Category:
Link Handling, Site Handling & Routing
Target version:
-
Start date:
2023-05-31
Due date:
% Done:

0%

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

Description

... if format t3://page?uid=current is used.

This manifests itself in

  1. links to current page with wrong anchor are not reported as broken in linkvalidator, see #100933
  2. no reference index entries are created for links to current page (this is described below)
  3. ...?

no reference index entries are created for links to current page

Reproduce

  1. create several links (see below) as page links, to current page, with anchor
  2. update the reference index
  3. check the database entries in the reference index

Expected result

The result should be the same whether t3://page?uid=current or t3://page?uid=<current page id> are used.

Actual result

The result is not the same:

No reference index entries are created for the links to current page (of format t3://page?uid=current or t3://page?uid=current#<anchor>). You can search for them by using the CE id, e.g.

select tablename,recuid,field,softref_key,softref_id,ref_table,ref_uid,ref_string from sys_refindex where tablename='tt_content' and (recuid=36 or recuid=37);

2 reference index entries are created for this link with target URL:

t3://page?uid=209#38
select tablename,recuid,field,softref_key,softref_id,ref_table,ref_uid,ref_string from sys_refindex where tablename='tt_content' and (recuid=38);
+------------+--------+----------+--------------+------------------------------------+------------+---------+------------+
| tablename  | recuid | field    | softref_key  | softref_id                         | ref_table  | ref_uid | ref_string |
+------------+--------+----------+--------------+------------------------------------+------------+---------+------------+
| tt_content |     38 | bodytext | typolink_tag | 1                                  | pages      |     209 |            |
| tt_content |     38 | bodytext | typolink_tag | d5747c9ecb74651c68d8215ed0c095ac:1 | tt_content |      38 |            |
+------------+--------+----------+--------------+------------------------------------+------------+---------+------------+

No reference index entries are created for this link with target URL:

t3://page?uid=current#38

No reference index entries are created for this link with target URL:

t3://page?uid=current

Source code

This seems to be due to TypolinkTagSoftReferenceParser::parse not considering links with the format t3://page?uid=current#99999999. The parser does not return the t3://page?uid=current links.

This also concerns TypolinkSoftReferenceParser.

code:

} elseif ($linkDetails['type'] === LinkService::TYPE_PAGE && preg_match('/page\?uid=(\d+)#?(\d+)?/', $matches[1], $pageAndAnchorMatches)) {

Related issues 2 (2 open0 closed)

Related to TYPO3 Core - Bug #100933: Checking internal links to current page with missing anchor is not reported as broken linkUnder Review2023-05-31

Actions
Related to TYPO3 Core - Bug #100935: Have a full description of (typolink) link formatNeeds Feedback2023-05-31

Actions
Actions

Also available in: Atom PDF