Bug #82917
openLink to file that are not visible should not be displayed (solution included)
0%
Description
A link to a invisble file (sys_file_metadata) should not be displayed using FileOrFolderLinkBuilder or ContentObjectRenderer.php
Adding the following code to FileOrFolderLinkBuilder->build solve the problem.
if ($fileOrFolderObject->getProperties()['visible'] === 0) {
throw new \TYPO3\CMS\Frontend\Typolink\UnableToLinkException(
'File "' . $linkDetails['typoLinkParameter'] . '" is not visible so "' . $linkText . '" was not linked.', 1490989449, null, $linkText
);
}
Updated by Frans Saris over 7 years ago
I'm not sure this is a good idea. As it would bring different behavior for how we handle files or we need to adjust a log of other places to have if consistent.
Further you only say the metadata isn't visible. Not that the file isn't visible. An editor will not recognize this in the file list etc.
All file handling is done on sys_file level. sys_file_metadata is only some extra metadata for the specific file that can differ for each language. So having this check on sys_file_metadata.visible would also be language dependent.
This is the same as the permission handling see https://docs.typo3.org/typo3cms/FileAbstractionLayerReference/singlehtml/Index.html#frontend-permissions the core only supports the fields but the core of TYPO3 doesn't do anything with this.
Updated by Susanne Moog about 5 years ago
- Sprint Focus deleted (
On Location Sprint)