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.

We're retiring the forums!

The SilverStripe forums have passed their heyday. They'll stick around, but will be read only. We'd encourage you to get involved in the community via the following channels instead:

Archive /

Our old forums are still available as a read-only archive.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo

Blog (.1) showing blank page on 2.2.2 related to BBCodeParser

Go to End

6 Posts   2005 Views


Community Member, 14 Posts

10 September 2008 at 3:38am

I was pulling my hair out last night trying to get the blog module to show properly using the BlogHolder and BlogEntry templates. Every time I tried to access the blog template, it would display a blank page. Did a few searches on the forum, turns out a few other people have this issue, but a fix was not available as it seems to be a scattered issue... which leads me to believe it's something on the server end?

After digging through the code, I found the culprit to be related to the BBCodeParser... if I removed any calls to it then the page would load fine. If the BBCodeParser was included, then it would not display. Any idea how I can get the BBCodeParser to function properly? Or should I remove it entirely.

I'm building this on a HostGator shared server.


Community Member, 14 Posts

10 September 2008 at 4:21am

The BlogHolder page works as intended after commenting out the BBCodeParser, but the blog summary is filled with line breaks... which are not present on the BlogEntry page.


Community Member, 470 Posts

10 September 2008 at 5:39am

Use a trunk build in the svn.


Community Member, 11 Posts

10 September 2008 at 1:50pm

I've been having similar issues to this - always getting a blank page for the blog pages.
I narrowed the problem down to the BBCodeParser.
Basically something goes wrong if you have the BBCodeParser installed as a Pear library - maybe php includes the wrong one?

Anyway I remove the BBCodeParser.php and BBCodeParser directory from your PEAR include directory it starts working fine.
I'm still looking for a slightly better work around - will post if I find one (and I'll log a bug too)



Community Member, 11 Posts

10 September 2008 at 3:48pm

Ok so the problem lies in the code to add filters:
line 216 of sapphire/parsers/HTML/HTMLBBCodeParser.php:
@include_once 'BBCodeParser/Filter/'.$filter.'.php';

The @ silences the errors which is a problem in itself.

Then when the filter file is include (eg Basic.php)
line 31: require_once 'HTML/BBCodeParser/Filter.php';

This is meant to include sapphire/parsers/HTML/BBCodeParser/Filter.php but actually includes from the pear include directory - since that comes first in my include path.

So the solution is to change the following line in sapphire/_config.php:
set_include_path(get_include_path() . PATH_SEPARATOR . $path);

set_include_path(str_replace('.' . PATH_SEPARATOR, '.' . PATH_SEPARATOR . $path . PATH_SEPARATOR, get_include_path()));

Thus putting the parsers directory ahead of the pear dir in the php include path. Or alternatively you could change the individual filter files to use relative paths for includes.



Community Member, 11 Posts

10 September 2008 at 7:20pm

Related ticket is here
Including patches