Jump to:

17452 Posts in 4473 Topics by 1971 members

Archive

SilverStripe Forums » Archive » Blog (.1) showing blank page on 2.2.2 related to BBCodeParser

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

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

Page: 1
Go to End
Author Topic: 1704 Views
  • pxlpshr
    Avatar
    Community Member
    14 Posts

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

    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.

  • pxlpshr
    Avatar
    Community Member
    14 Posts

    Re: Blog (.1) showing blank page on 2.2.2 related to BBCodeParser Link to this post

    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.

  • Liam
    Avatar
    Community Member
    470 Posts

    Re: Blog (.1) showing blank page on 2.2.2 related to BBCodeParser Link to this post

    Use a trunk build in the svn.

  • rjmackay
    Avatar
    Community Member
    11 Posts

    Re: Blog (.1) showing blank page on 2.2.2 related to BBCodeParser Link to this post

    Hey,
    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)

    Robbie

  • rjmackay
    Avatar
    Community Member
    11 Posts

    Re: Blog (.1) showing blank page on 2.2.2 related to BBCodeParser Link to this post

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

    to:
    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.

    PATCH IS ATTACHED

  • rjmackay
    Avatar
    Community Member
    11 Posts

    Re: Blog (.1) showing blank page on 2.2.2 related to BBCodeParser Link to this post

    Related ticket is here http://open.silverstripe.com/ticket/2790
    Including patches

    1704 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.