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've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Blog Module /

Discuss the Blog Module.

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

Bad widget class name given


Go to End


8 Posts   3471 Views

Avatar
jkeslin

Community Member, 2 Posts

18 December 2008 at 9:30am

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

Community Member, 2 Posts

18 December 2008 at 12:34pm

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

Community Member, 16 Posts

14 January 2009 at 5:46am

Edited: 14/01/2009 5:48am

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

Community Member, 16 Posts

14 January 2009 at 6:03am

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

Community Member, 46 Posts

21 January 2009 at 3:29pm

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

Community Member, 7 Posts

27 January 2009 at 6:23am

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

Community Member, 7 Posts

27 January 2009 at 3:18pm

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

Community Member, 219 Posts

18 January 2012 at 11:14pm

Edited: 18/01/2012 11:22pm

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/