MDL-82541 core_courseformat: delegated sections in disabled plugins
This commit is contained in:
@@ -59,7 +59,11 @@ abstract class sectiondelegate {
|
||||
if ($classname === null) {
|
||||
return null;
|
||||
}
|
||||
return new $classname($sectioninfo);
|
||||
$instance = new $classname($sectioninfo);
|
||||
if (!$instance->is_enabled()) {
|
||||
return null;
|
||||
}
|
||||
return $instance;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -84,6 +88,16 @@ abstract class sectiondelegate {
|
||||
return self::get_delegate_class_name($pluginname) !== null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if the delegate is enabled.
|
||||
*
|
||||
* Usually this happens when the delegate plugin is disabled.
|
||||
* @return bool
|
||||
*/
|
||||
public function is_enabled(): bool {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Define the section final name.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user