mirror of
https://github.com/moodle/moodle.git
synced 2025-08-04 16:36:37 +02:00
MDL-22054 skip loading of missing modules
This commit is contained in:
parent
8c25522551
commit
fc61cecd6a
2 changed files with 7 additions and 0 deletions
|
@ -11,6 +11,9 @@ if ($hassiteconfig) {
|
||||||
$modulebyname = array();
|
$modulebyname = array();
|
||||||
|
|
||||||
foreach ($modules as $module) {
|
foreach ($modules as $module) {
|
||||||
|
if (!file_exists("$CFG->dirroot/mod/$module->name/lib.php")) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
$strmodulename = get_string('modulename', $module->name);
|
$strmodulename = get_string('modulename', $module->name);
|
||||||
// Deal with modules which are lacking the language string
|
// Deal with modules which are lacking the language string
|
||||||
if ($strmodulename == '[[modulename]]') {
|
if ($strmodulename == '[[modulename]]') {
|
||||||
|
|
|
@ -2825,6 +2825,10 @@ function &get_fast_modinfo(&$course, $userid=0) {
|
||||||
$minimalmodinfo=new stdClass();
|
$minimalmodinfo=new stdClass();
|
||||||
$minimalmodinfo->cms=array();
|
$minimalmodinfo->cms=array();
|
||||||
foreach($info as $mod) {
|
foreach($info as $mod) {
|
||||||
|
if (empty($mod->name)) {
|
||||||
|
// something is wrong here
|
||||||
|
continue;
|
||||||
|
}
|
||||||
$minimalcm = new stdClass();
|
$minimalcm = new stdClass();
|
||||||
$minimalcm->id = $mod->cm;
|
$minimalcm->id = $mod->cm;
|
||||||
$minimalcm->name = $mod->name;
|
$minimalcm->name = $mod->name;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue