Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-50325

Inconsistent check for missing module

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Fixed
    • Icon: Minor Minor
    • 3.6
    • 3.0, 3.5.1, 3.6
    • Libraries
    • MOODLE_30_STABLE, MOODLE_35_STABLE, MOODLE_36_STABLE
    • MOODLE_36_STABLE
    • MDL-50325_inconsistent_check_missing_module
    • Hide

      Before the fix

      Rename mod/assign/version.php to mod/assign/version.php.deleted
      Purge all caches.
      Go to <MOODLE_URL>/admin/plugins.php and notice that Assignment (mod_assign) is maked as "Missing from disk!".
      Go to <MOODLE_URL>/admin/modules.php and notice that Assignment module is showing as just fine.

      Rename back mod/assign/version.php.deleted to mod/assign/version.php
      Rename mod/assign/lib.php to mod/assign/lib.php.deleted
      Purge all caches.
      Go to <MOODLE_URL>/admin/plugins.php and notice that Assignment module is showing as just fine.
      Go to <MOODLE_URL>/admin/modules.php and notice assign (Missing from disk).

      This is reverse to the previous case.

      After the fix

      Rename mod/assign/version.php to mod/assign/version.php.deleted
      Purge all caches.

      Go to both pages:

      • <MOODLE_URL>/admin/plugins.php
      • <MOODLE_URL>/admin/modules.php
        and confirm that on both the assign module shows as missing.
      Show
      Before the fix Rename mod/assign/version.php to mod/assign/version.php.deleted Purge all caches. Go to <MOODLE_URL>/admin/plugins.php and notice that Assignment (mod_assign) is maked as "Missing from disk!". Go to <MOODLE_URL>/admin/modules.php and notice that Assignment module is showing as just fine. Rename back mod/assign/version.php.deleted to mod/assign/version.php Rename mod/assign/lib.php to mod/assign/lib.php.deleted Purge all caches. Go to <MOODLE_URL>/admin/plugins.php and notice that Assignment module is showing as just fine. Go to <MOODLE_URL>/admin/modules.php and notice assign (Missing from disk). This is reverse to the previous case. After the fix Rename mod/assign/version.php to mod/assign/version.php.deleted Purge all caches. Go to both pages: <MOODLE_URL>/admin/plugins.php <MOODLE_URL>/admin/modules.php and confirm that on both the assign module shows as missing.

      In admin/modules.php we check if module is missing by:

              if (!file_exists("$CFG->dirroot/mod/$module->name/lib.php")) {
                  $strmodulename = '<span class="notifyproblem">'.$module->name.' ('.get_string('missingfromdisk').')</span>';
                  $missing = true;
      

      but in other places core\plugininfo\base::get_status() is used:

      if (!is_null($this->versiondb) and is_null($this->versiondisk)) {
                  if (core_plugin_manager::is_deleted_standard_plugin($this->type, $this->name)) {
                      return core_plugin_manager::PLUGIN_STATUS_DELETE;
                  } else {
                      return core_plugin_manager::PLUGIN_STATUS_MISSING;
      

      The difference is:
      <MOODLE_URL>/admin/modules.php is checking if lib.php exists each time
      <MOODLE_URL>/admin/plugins.php is checking for version.php and the result is cached.

            cyvanes Charles YVANES
            tmuras Tomasz Muras
            Luca Bösch Luca Bösch
            Eloy Lafuente (stronk7) Eloy Lafuente (stronk7)
            Simey Lameze Simey Lameze
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.