Bug #82917

Link to file that are not visible should not be displayed (solution included)

Added by Simon Ouellet about 2 years ago. Updated about 1 year ago.

Status:
New
Priority:
Should have
Assignee:
-
Category:
Link Handling, Site Handling & Routing
Target version:
-
Start date:
2017-11-03
Due date:
% Done:

0%

TYPO3 Version:
8
PHP Version:
7.0
Tags:
Complexity:
Is Regression:
Sprint Focus:
On Location Sprint

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
    );
}

History

#1 Updated by Frans Saris about 2 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.

#2 Updated by Susanne Moog about 1 year ago

  • Sprint Focus set to On Location Sprint

Also available in: Atom PDF