Unknown Variable $file in FileTitleViewHelper and FileDescriptionViewHelper

Issue #56 resolved
Philipp Seßner created an issue

Hi,

in both viewHelpers, $file is used in render method but never declared. Easiest fix would be to add as first line

$file = $this->arguments['file'];

That bug is present from at least version 2.0.2 on, I guess it happened when moving the argument from render parameter to initializeArguments.

Currently no description nor title are displayed, which might be crucial for copy rights and such.

Comments (9)

  1. Philipp Seßner reporter

    @Frans Saris I think I cannot create a PR for your repository, please check this commit: https://bitbucket.org/Lumrenion/fs_media_gallery/commits/9a8eec7ad4d20f62020fcb68c4c9e91c1ac0c437

    Sorry, I am not so familiar with butbucket, I liked it when this extension was at github 🙂

    Explanation to the removed code:

    Checking for $file being instanceof FileInterface is not required here as it is done automatically from the internal ViewHelper stuff, when the ViewHelper argument is assigned.

    FileReference can overwrite the properties of File when checking the checkbox in the TYPO3 backend. FileReference then merges the properties of it’s original File. Also FileReference does not have this method, I think it comes from Extbase’s FileReference or so.

  2. Log in to comment