Bug #100934
openTypolink soft reference parsers does not consider links to currrent page
0%
Description
... if format t3://page?uid=current is used.
This manifests itself in
- links to current page with wrong anchor are not reported as broken in linkvalidator, see #100933
- no reference index entries are created for links to current page (this is described below)
- ...?
no reference index entries are created for links to current page¶
Reproduce¶
- create several links (see below) as page links, to current page, with anchor
- update the reference index
- 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)) {