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

Inconsistent check for missing module

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.0, 3.5.1, 3.6
    • Fix Version/s: 3.6
    • Component/s: Libraries
    • Testing Instructions:
      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.
    • Affected Branches:
      MOODLE_30_STABLE, MOODLE_35_STABLE, MOODLE_36_STABLE
    • Fixed Branches:
      MOODLE_36_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-50325_inconsistent_check_missing_module

      Description

      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.

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Fix Release Date:
                3/Dec/18