MDL-84421 tool_uploadcourse: Stop MUC caching enrol instances

We should not normally cache instances of a class. This can lead to poor
design to work around the limitations of PHP Serialization, and could
theoretically cause issues with PHP versions changing within a Moodle
version.
This commit is contained in:
Andrew Nicols
2025-02-04 22:14:09 +08:00
parent 89e6f737cc
commit 8b3d6c3259
+1 -6
View File
@@ -177,12 +177,7 @@ class tool_uploadcourse_helper {
* @return enrol_plugin[]
*/
public static function get_enrolment_plugins() {
$cache = cache::make('tool_uploadcourse', 'helper');
if (($enrol = $cache->get('enrol')) === false) {
$enrol = enrol_get_plugins(false);
$cache->set('enrol', $enrol);
}
return $enrol;
return enrol_get_plugins(false);
}
/**