Jump to:

1835 Posts in 1139 Topics by 554 members

Blog Module

SilverStripe Forums » Blog Module » Bad widget class name given

Discuss the Blog Module.

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

Page: 1
Go to End
Author Topic: 2256 Views
  • jkeslin
    Avatar
    Community Member
    2 Posts

    Bad widget class name given Link to this post

    I installed silverstripe and installed the blog module. That was working great to start. I moved the blog module to my home page, and then decided to add a second blog holder. Once I added the second blog holder, I tried to add the blog management widget and got the error "Bad widget class name given". I tracked the error to Widget.php...

    <pre>
    class Widget_Controller extends Controller {
    function editablesegment() {
    $className = $this->urlParams['ID'];
    if(class_exists($className) && is_subclass_of($className, 'Widget')) {
    $obj = new $className();
    return $obj->EditableSegment();
    } else {
    user_error("Bad widget class: $className", E_USER_WARNING);
    return "Bad widget class name given";
    }
    }
    }
    </pre>

    I don't understand how the class exists for the home page blog holder, but doesn't appear to exist for the 2nd blog holder that I created.

    Any help or direction would be appreciated.

  • jkeslin
    Avatar
    Community Member
    2 Posts

    Re: Bad widget class name given Link to this post

    I got it to work... but I'm not sure what I did. I deleted the second blog, removed all blog widgets. I then reinstalled the 2nd blog holder and it still didn't work. I remember setting up a debug url and decided to use my debug url and I was able to add both sets of widgets when I opened up the CMS admin in the debug url. I published and booya! Now, I'm good to go!

  • svinkle
    Avatar
    Community Member
    16 Posts

    Re: Bad widget class name given Link to this post

    I've found that this happens in v2.3 rc2. Blog widgets in v2.2.3 work fine. Does anyone have a proper solution to this for v2.3? Will this be fixed when v2.3 goes stable?

  • svinkle
    Avatar
    Community Member
    16 Posts

    Re: Bad widget class name given Link to this post

    Further testing has uprooted a solution. This error appears when the user creates a blog holder page, attempts to add a widget, but has not yet published said page. Only after the blog holder page has been published will the system allow the user to add widgets. This has been tested in v2.3 rc2.

  • Apophenian
    Avatar
    Community Member
    46 Posts

    Re: Bad widget class name given Link to this post

    I have published the blogholder page, but was still not able to add widgets. This is with 2.3 rc 2 and the latest blog module in trunk.

    I had to resort to adding the widgets manually in the database...

  • pecos_red
    Avatar
    Community Member
    7 Posts

    Re: Bad widget class name given Link to this post

    I'm having the same problem, but only on the server--everything works fine on my development machine. I'm quite sure all the files match in both locations.

    I can add widgets to BlogHolder pages but not to other page types.

    Apophenian, can you explain how you added the widgets in the database?

  • pecos_red
    Avatar
    Community Member
    7 Posts

    Re: Bad widget class name given Link to this post

    Got my widgets working. ;-)

    I don't know for sure if this is what got them to work or what, but after I added the Archive Widget to the widget area, then I was able to add others, and then delete the archive widget.

  • CHD
    Avatar
    Community Member
    217 Posts

    Re: Bad widget class name given Link to this post

    We got our widgets working on all pages eventually, here's our solution. Hopefully it helps!

    http://www.clickheredigital.co.uk/blog/bad-widget-class-name-given-our-experience-with-widgets-on-any-silverstripe-page/

    2256 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.