mirror of
https://github.com/silverstripe/silverstripe-widgets
synced 2024-10-22 17:05:54 +02:00
Merge pull request #45 from g4b0/check-array-before-shifting
Bugfix: check array before shifting
This commit is contained in:
commit
5eabb1b305
@ -40,7 +40,7 @@ class WidgetAreaEditor extends FormField {
|
|||||||
|
|
||||||
foreach($this->widgetClasses as $widgetClass) {
|
foreach($this->widgetClasses as $widgetClass) {
|
||||||
$classes = ClassInfo::subclassesFor($widgetClass);
|
$classes = ClassInfo::subclassesFor($widgetClass);
|
||||||
array_shift($classes);
|
if(count($classes) > 1) array_shift($classes);
|
||||||
foreach($classes as $class) {
|
foreach($classes as $class) {
|
||||||
$widgets->push(singleton($class));
|
$widgets->push(singleton($class));
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user