Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

Forum Module

Discuss the Forum Module.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Filename cannot be empty

Go to End

10 Posts   9625 Views


26 March 2009 at 1:40am Community Member, 14 Posts

when i finish install modules forum and i star forum , please hellp me ---->

[Warning] file_get_contents() [function.file-get-contents]: Filename cannot be empty
GET /SilverStripe-v2.3.0/forums/

Line 273 in C:\wamp\www\SilverStripe-v2.3.0\sapphire\core\SSViewer.php

264    /**
265     * Used by <% include Identifier %> statements to get the full
266     * unparsed content of a template file.
267     *
268     * @uses getTemplateFile()
269     * @param string $identifier A template name without '.ss' extension or path.
270     * @return string content of template
271     */
272    public static function getTemplateContent($identifier) {
273       return file_get_contents(SSViewer::getTemplateFile($identifier));
274    }
276    /**
277     * @ignore
278     */
279    static private $flushed = false;


///////please hellp me , thanks


16 April 2009 at 3:54am (Last edited: 16 April 2009 3:54am), Community Member, 35 Posts

I have same error with blog module


16 April 2009 at 8:48pm Forum Moderator, 5511 Posts


Now I am assuming this is the URL of the page but make sure anyway that the forum folder in the filesystem is named 'forum' and not 'forum-0.2' or something


23 April 2009 at 3:59pm Community Member, 42 Posts

I am experiencing a similar problem after upgrading to 2.3.2. It was working for days, it seems, but now I can't even get to the url.

It's probably something obvious, but I can't seem to fix it. Please help!

Below is the error description:

[Warning] file_get_contents() [function.file-get-contents]: Filename cannot be empty

Line 277 in /home/feverpea/public_html/atgvw/silverstripe/sapphire/core/SSViewer.php

268    /**
269     * Used by <% include Identifier %> statements to get the full
270     * unparsed content of a template file.
271     *
272     * @uses getTemplateFile()
273     * @param string $identifier A template name without '.ss' extension or path.
274     * @return string content of template
275     */
276    public static function getTemplateContent($identifier) {
277       return file_get_contents(SSViewer::getTemplateFile($identifier));
278    }
280    /**
281     * @ignore
282     */
283    static private $flushed = false;


* file_get_contents()
Line 277 of SSViewer.php
* SSViewer::getTemplateContent(BreadCrumbs)
Line 2 of SSViewer.php(397) : runtime-created function
* __lambda_func(Array)
* preg_replace_callback(/<% include +([A-Za-z0-9_]+) +%>/,�lambda_6,<!-- template /home/feverpea/public_html/atgvw/silverstripe/themes/atg/templates/Layout/ --> <div class="postheader"> <h1>$Title</h1> </div> <div class="postcontent typography"> <% if Level(2) %> <% include BreadCrumbs %> <% end_if %> $Content $Form $PageComments </div> <!-- end template /home/feverpea/public_html/atgvw/silverstripe/themes/atg/templates/Layout/ -->)
Line 397 of SSViewer.php
* SSViewer::parseTemplateContent( <div class="postheader"> <h1>$Title</h1> </div> <div class="postcontent typography"> <% if Level(2) %> <% include BreadCrumbs %> <% end_if %> $Content $Form $PageComments </div>,/home/feverpea/public_html/atgvw/silverstripe/themes/atg/templates/Layout/
Line 321 of SSViewer.php
* SSViewer->process(Page_Controller)
Line 346 of SSViewer.php
* SSViewer->process(Page_Controller)
Line 175 of Controller.php
* Controller->handleAction(HTTPRequest)
Line 107 of RequestHandler.php
* RequestHandler->handleRequest(HTTPRequest)
Line 122 of Controller.php
* Controller->handleRequest(HTTPRequest)
Line 28 of ModelAsController.php
* ModelAsController->handleRequest(HTTPRequest)
Line 34 of RootURLController.php
* RootURLController->handleRequest(HTTPRequest)
Line 277 of Director.php
* Director::handleRequest(HTTPRequest,Session)
Line 121 of Director.php
* Director::direct(/)
Line 115 of main.php


23 April 2009 at 4:07pm Forum Moderator, 5511 Posts

This fixed someone elses problem in another thread

return file_get_contents(SSViewer::getTemplateFile($identifier));


return (SSViewer::getTemplateFile($identifier)) ? file_get_contents(SSViewer::getTemplateFile($identifier)) : '';

I do not know what is causing this, could be a templating issue


24 April 2009 at 2:23am Community Member, 42 Posts

Worked like a charm. Thanks!

Bruce B

24 September 2009 at 4:42pm Community Member, 145 Posts

This fixed my problem. It only happened after installing Snow Leopard on my development server/laptop. I suspect the cause of this particular problem is that PHP error reporting seems to be set to include 'STRICT' errors. This doesn't seem to be under the control of the php.ini file. I'll dig deeper at a later stage but for now this change has fixed it.


2 October 2009 at 2:55am (Last edited: 2 October 2009 2:57am), Community Member, 40 Posts

I suddenly received this error when I added the and the layout templates while following tutorial 2 ( -> 3/4 down the page).

very bizarre because when I simply remove these 2 layout templates - it works (and the Staff stuff default to I guess) - as soon as I put them back in I receive this error.

I made the change in SSViewer.php but I'm very unhappy that I have to change Core files to resolve this (will it come back when I do a future upgrade?).

Shouldn't this be added to some kind of BUG list so it will get addressed properly?

PS: I'm also running Snow Leopard with MAMP..

Go to Top