Merge branch 'MDL-50325_inconsistent_check_missing_module' of http://github.com/enova...
authorEloy Lafuente (stronk7) <stronk7@moodle.org>
Tue, 7 Aug 2018 22:06:09 +0000 (00:06 +0200)
committerEloy Lafuente (stronk7) <stronk7@moodle.org>
Tue, 7 Aug 2018 22:06:09 +0000 (00:06 +0200)
admin/modules.php

index fb112e7..01f67a1 100644 (file)
     $table->set_attribute('class', 'admintable generaltable');
     $table->setup();
 
+    $pluginmanager = core_plugin_manager::instance();
+
     foreach ($modules as $module) {
+        $plugininfo = $pluginmanager->get_plugin_info('mod_'.$module->name);
+        $status = $plugininfo->get_status();
 
-        if (!file_exists("$CFG->dirroot/mod/$module->name/lib.php")) {
+        if ($status === core_plugin_manager::PLUGIN_STATUS_MISSING) {
             $strmodulename = '<span class="notifyproblem">'.$module->name.' ('.get_string('missingfromdisk').')</span>';
             $missing = true;
         } else {