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.

Blog Module

Discuss the Blog Module.

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

Bad widget class name given


Reply

8 Posts   2336 Views

Avatar
jkeslin

18 December 2008 at 9:30am Community Member, 2 Posts

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.

Avatar
jkeslin

18 December 2008 at 12:34pm Community Member, 2 Posts

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!

Avatar
svinkle

14 January 2009 at 5:46am (Last edited: 14 January 2009 5:48am), Community Member, 16 Posts

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?

Avatar
svinkle

14 January 2009 at 6:03am Community Member, 16 Posts

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.

Avatar
Apophenian

21 January 2009 at 3:29pm Community Member, 46 Posts

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

Avatar
pecos_red

27 January 2009 at 6:23am Community Member, 7 Posts

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?

Avatar
pecos_red

27 January 2009 at 3:18pm Community Member, 7 Posts

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.

Avatar
CHD

18 January 2012 at 11:14pm (Last edited: 18 January 2012 11:22pm), Community Member, 218 Posts

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/