Bug #87652
closedSoftReferenceIndex :: TypoLink :: links like "t3:// FileLinks" won't be recognized
0%
Description
Our customer has complained about missing references in the file list.
After some debugging, we noticed the following:
We have some extensions which have some input fields as typolinks:
<config type="array"> <type>input</type> <renderType>inputLink</renderType> <softref>typolink</softref> <size>100</size> <max>512</max> <eval>trim</eval> <fieldControl> <linkPopup> <options> <title>Link</title> </options> </linkPopup> </fieldControl> </config>
The SoftReferenceIndexer does not recognize those links, so the filelist does show zeros references, and our client startet to delete those files.
The problem is located inside the function
TYPO3\CMS\Core\Database\SoftReferenceIndex::getTypoLinkParts
Old Code:
// Check for FAL link-handler keyword
if ($linkHandlerKeyword === 'file') {
$finalTagParts['LINK_TYPE'] = 'file';
$finalTagParts['identifier'] = trim($link_param);
return $finalTagParts;
}
This will only work for old-syntaxed file links like "file:nnnn" but not for the new syntax "t3://file::".
I've added the followeing code snipped, fot the new syntax file links:
if ($linkHandlerKeyword === 't3') {
// linking to any t3:// syntax
if (stripos($link_param, 't3://') === 0) {
// lets parse the urn
$linkParsed = parse_url($link_param);
if (isset($linkParsed['host']) && isset($linkParsed['scheme']) && isset($linkParsed['query'])){
$identifier = $linkParsed['host'];
$scheme = $linkParsed['scheme'];
$query = $linkParsed['query'];
$finalTagParts['LINK_TYPE'] = $identifier;
if($query && $identifier === 'file' ){
$queryparts = explode('=', $query);
if($queryparts){
if(is_array($queryparts)){
$queryKey = $queryparts[0];
$queryValue = (integer) $queryparts[1];
if (is_int($queryValue)){
$finalTagParts['identifier'] = "$identifier:$queryValue";
unset($linkParsed);
unset($queryparts);
return $finalTagParts;
}
}
}
}
}
}
}
When saving those records in the backend or when we trigger to rebuild the refindex, those links will now be recognized.
Files
Updated by Benni Mack over 5 years ago
- Category changed from Miscellaneous to Site Handling, Site Sets & Routing
Updated by Benni Mack about 5 years ago
- Related to Bug #84016: impexp: page links are parsed / replaced incorrectely due to error in SoftReferenceIndex added
Updated by Benni Mack about 5 years ago
- Related to Bug #88207: SoftReferenceIndex is missing support for t3://file uri added
Updated by Benni Mack about 5 years ago
- Status changed from New to Resolved
Fixed with issue #84016 - will be released in the next v9 / v10 versions.
Updated by Markus Hackel about 5 years ago
Will this fix also be integrated into v8?