mirror of
https://github.com/moodle/moodle.git
synced 2025-03-14 04:30:15 +01:00
MDL-18375 calendar: added condition to ensure calendar type exists before loading
This commit is contained in:
parent
5989677e0f
commit
2aefba53a5
@ -40,6 +40,13 @@ class type_factory {
|
||||
}
|
||||
|
||||
$class = "\\calendartype_$type\\structure";
|
||||
|
||||
// Ensure the calendar type exists. It may occur that a user has selected a calendar type, which was then
|
||||
// deleted. If this happens we want to fall back on the Gregorian calendar type.
|
||||
if (!class_exists($class)) {
|
||||
$class = "\\calendartype_gregorian\\structure";
|
||||
}
|
||||
|
||||
return new $class();
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user