FIX: Ensure available widgets list is consistent between versions (#6292)

This commit is contained in:
Will Rossiter 2013-05-07 22:22:41 +12:00
parent dd6ffbfaf8
commit 0536ad31ce

View File

@ -42,8 +42,11 @@ class WidgetAreaEditor extends FormField {
foreach($this->widgetClasses as $widgetClass) { foreach($this->widgetClasses as $widgetClass) {
$classes = ClassInfo::subclassesFor($widgetClass); $classes = ClassInfo::subclassesFor($widgetClass);
if(count($classes) > 1) { if (isset($classes['Widget'])) {
array_shift($classes); unset($classes['Widget']);
}
else if (isset($classes[0]) && $classes[0] == 'Widget') {
unset($classes[0]);
} }
foreach($classes as $class) { foreach($classes as $class) {