Issue Bug Rejected

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

Simon Ouellet 11/03/17, 20:48 updated 04/03/25, 07:09

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

Reviews 0

No change resolves or names this issue in its commit message, and no comment links one.

History 4

  1. Frans Saris commented 11/05/17, 00:34

    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. Susanne Moog changed Sprint Focus On Location Sprint 10/25/18, 11:59

  3. Susanne Moog changed Sprint Focus On Location Sprint 01/12/20, 12:06

  4. Georg Ringer commented and changed status New Rejected 04/03/25, 07:09

    visible is just a checkbox field, there is no real usage in the core. so this is not an access field like hidden of a page/content element