Project

General

Profile

Bug #100934

Updated by Sybille Peters 12 months ago

... 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) 
 # ...? 


 h1. no reference index entries are created for links to current page 

 h2. 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 


 h2. Expected result 

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

 h2. 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. 

 <pre><code class="sql"> 
 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); 
 </code></pre> 

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

 <pre> 
 t3://page?uid=209#38 
 </pre> 


 <pre> 
 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 |              | 
 +------------+--------+----------+--------------+------------------------------------+------------+---------+------------+ 

 </pre> 

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

 <pre> 
 t3://page?uid=current#38 
 </pre> 


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

 <pre> 
 t3://page?uid=current 
 </pre> 

 h2. 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: 

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


 * https://github.com/TYPO3/typo3/blob/main/typo3/sysext/core/Classes/DataHandling/SoftReference/TypolinkTagSoftReferenceParser.php 
 * https://github.com/TYPO3/typo3/blob/main/typo3/sysext/core/Classes/DataHandling/SoftReference/TypolinkSoftReferenceParser.php 

Back