-
Improvement
-
Resolution: Duplicate
-
Minor
-
None
-
2.6.7, 2.6.8, 2.6.9, 2.6.10, 2.6.11, 2.7.4, 2.7.5, 2.7.6, 2.7.7, 2.7.8, 2.8.2, 2.8.3, 2.8.4, 2.8.5, 2.8.6, 2.9
-
MOODLE_26_STABLE, MOODLE_27_STABLE, MOODLE_28_STABLE, MOODLE_29_STABLE
The settings.php file inside an availability plugin is ignored.
The reason is the method load_settings is not overrided for the availability class (in lib/classes/plugininfo/availability.php)
adding the following chunk to the availability class definition could resolve the issue:
public function load_settings(\part_of_admin_tree $adminroot, $parentnodename, $hassiteconfig) {
|
global $CFG, $USER, $DB, $OUTPUT, $PAGE; // In case settings.php wants to refer to them.
|
$ADMIN = $adminroot; // May be used in settings.php.
|
$plugininfo = $this; // Also can be used inside settings.php.
|
|
if (!$this->is_installed_and_upgraded()) {
|
return;
|
}
|
|
if (file_exists($this->full_path('settings.php'))) {
|
include($this->full_path('settings.php'));
|
}
|
}
|
- duplicates
-
MDL-49620 Availability conditions do not support admin settings.
- Closed