Bug #6822

unhelpful error message if template cannot be read

Added by Florian Staudacher almost 12 years ago. Updated over 10 years ago.

Should have
Target version:
Start date:
Due date:
% Done:


Estimated time:
Has patch:


I reported this bug there: http://bugs.typo3.org/view.php?id=13810 earlier and was told to put it here, so here it comes:

in typo3/sysext/fluid/Classes/View/TemplateView.php on line 358 the method parseTemplate() should return a helpful error message in case the file cannot be read.
I had forgotten to give the server read access to my template file and the only thing i got over and over was

Parse requires a template string as argument, boolean given.

from the typo3/sysext/fluid/Classes/Core/Parser/TemplateParser.php on line 271.
I mean if you know that file_get_contents returns false if there is an error, it's simple to look for the error, but even that involves looking at the code to see how the file gets read.

Please replace with/add a more suiting error message


Updated by Sebastian Kurfuerst almost 12 years ago

  • Status changed from New to Needs Feedback


thanks for your bug report. I think this has been solved meanwhile in the newest Fluid Trunk. At least in https://svn.typo3.org/TYPO3v4/CoreProjects/MVC/fluid/trunk/Classes/View/TemplateView.php the method parseTemplate now has a proper error message:

    protected function parseTemplate($templatePathAndFilename) {
        $templateSource = file_get_contents($templatePathAndFilename);
        if ($templateSource === FALSE) {
            throw new Tx_Fluid_View_Exception_InvalidTemplateResourceException('"' . $templatePathAndFilename . '" is not a valid template resource URI.', 1257246929);
        return $this->templateParser->parse($templateSource);

Do you agree on this?



Updated by Florian Staudacher almost 12 years ago

I guess if the error message gets documented in some way (online or what not), there would be a list of possible reasons and then file permissions should be added to that list. But since documentation is relatively rare at the moment, this message is definately better than before.


Updated by Sebastian Kurfuerst over 10 years ago

  • Status changed from Needs Feedback to Closed

thanks for the feedback!

Also available in: Atom PDF