Jump to:

17452 Posts in 4473 Topics by 1971 members

Archive

SilverStripe Forums » Archive » Blog Error - SS 2.2.2 - Tried all blog versions

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

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

Page: 1 2 3 4
Go to End
Author Topic: 11008 Views
  • AndyWiltshireNZ
    Avatar
    Community Member
    35 Posts

    Re: Blog Error - SS 2.2.2 - Tried all blog versions Link to this post

    So I am trying to add widgets to all other pages by following the doc. But its not working.

    The mysite/code/Page.php looks like this...

    class Page extends SiteTree {
       static $db = array(
       );
    static $has_one = array(
       "Sidebar" => "WidgetArea",
    );
       
    function getCMSFields() {
       $fields = parent::getCMSFields();
       $fields->addFieldToTab("Root.Content.Widgets", new WidgetAreaEditor("Sidebar"));
       return $fields;
    }
    }

    But I find this a little confusing...

    Then in your Template you need to call $SideBar whereever you want to render the widget
    themes/myThemeName/templates/Includes/Sidebar.ss

    $Sidebar


    Ive tried adding $Sidebar in several places, and I have done the db/build, but its still not showing the sidebar. I did remove the sidebar from the blog too, as to avoid a double up as recommended.

    Thanks in advance,

    Andy

  • simon_w
    Avatar
    Forum Moderator
    467 Posts

    Re: Blog Error - SS 2.2.2 - Tried all blog versions Link to this post

    How does the blog part of the theme you're using do it?

    Just copy that.

  • AndyWiltshireNZ
    Avatar
    Community Member
    35 Posts

    Re: Blog Error - SS 2.2.2 - Tried all blog versions Link to this post

    Okey Dokey, thanks for all the help guys, Ive finally got it all 'mostly' working, besides the small bug with the security > members backend (http://www.silverstripe.com/site-builders-forum/flat/81598), you can view the site here: http://bombr.net

    What I need now is a widget for the home page to display popular forum threads: http://www.silverstripe.com/extending-hacking-silverstripe-forum/flat/81722#post81722

    Thanks for the assistance again, much appreciated!

  • AndyWiltshireNZ
    Avatar
    Community Member
    35 Posts

    Re: Blog Error - SS 2.2.2 - Tried all blog versions Link to this post

    Never did this solve this problem, but with a fresh install of SS 2.2.2, the Blog module current version and/or the daily build version, I get a blank page for the blog entries. I read that its potentially something to do with widgets or templates, but cannot figure out a solution. Ive tried every combination of versions of both SS and the Blog module, but it always seems to happen. I have dev mode enabled, but there are no errors outputed, so I don't even know where to start.

    On one of my trial sites I managed to get it going, but I can't tell why, because I simply went through and installed all the main modules in one hit. Ive tried it with the default blackcandy template and various others with no success. I have also seen that others have had the same problem, but no solutions were offered.

    (On a side not, how come this forum doesnt work with line breaks? Its kinda annoying how it groups all the text together... )

  • Willr
    Avatar
    Forum Moderator
    5462 Posts

    Re: Blog Error - SS 2.2.2 - Tried all blog versions Link to this post

    Do you get the blank page in dev mode? any errors in your apache / php logs

  • AndyWiltshireNZ
    Avatar
    Community Member
    35 Posts

    Re: Blog Error - SS 2.2.2 - Tried all blog versions Link to this post

    Im managing to get the following output if I refresh the page a few times:

    Debug (line 118 of BBCodeParser.php): Congratulations, the SilverStripe blog module has been successfully installed. This blog entry can be safely deleted. You can configure aspects of your blog (such as the widgets displayed in the sidebar) in <a href="admin">the CMS</a>.


    This is a fresh install of SS 2.2.2 with the standard blog module version.
    I replaced the BBCode parsers with the Daily build versions and it seems to have cleared up that debug line, but...
    Its very strange, if I navigate straight to the blog holder or blog entry I get a blank page, but if I refresh the page 2-3 times it eventually loads...

  • rjmackay
    Avatar
    Community Member
    11 Posts

    Re: Blog Error - SS 2.2.2 - Tried all blog versions 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 Error - SS 2.2.2 - Tried all blog versions 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

    11008 Views
Page: 1 2 3 4
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.