Update WidgetAreaEditor.php

This commit is contained in:
sinan-evanshunt 2018-09-06 09:43:05 -06:00 committed by GitHub
parent 4dccc49a41
commit ac1c1dabc8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -50,15 +50,17 @@ class WidgetAreaEditor extends FormField
unset($classes[0]);
}
foreach ($classes as $class) {
$available = Config::inst()->get($class, 'only_available_in');
if (!empty($available) && is_array($available)) {
if (in_array($this->Name, $available)) {
if( isset($classes) ){
foreach ($classes as $class) {
$available = Config::inst()->get($class, 'only_available_in');
if (!empty($available) && is_array($available)) {
if (in_array($this->Name, $available)) {
$widgets->push(singleton($class));
}
} else {
$widgets->push(singleton($class));
}
} else {
$widgets->push(singleton($class));
}
}
}