Project

General

Profile

Actions

Bug #82917

open

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

Added by Simon Ouellet over 6 years ago. Updated over 4 years ago.

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

0%

Estimated time:
TYPO3 Version:
8
PHP Version:
7.0
Tags:
Complexity:
Is Regression:
Sprint Focus:

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
    );
}
Actions #1

Updated by Frans Saris over 6 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.

Actions #2

Updated by Susanne Moog over 5 years ago

  • Sprint Focus set to On Location Sprint
Actions #3

Updated by Susanne Moog over 4 years ago

  • Sprint Focus deleted (On Location Sprint)
Actions

Also available in: Atom PDF