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

improve check for invalid plugin in mod dir

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.4
    • Fix Version/s: 2.5
    • Component/s: Libraries
    • Labels:
    • Testing Instructions:
      Hide

      1/ put block into module and other plugin dir - try upgrade/install
      2/ put module into block and other plugin dir - try upgrade/install
      3/ put other plugin into block and module dir - try upgrade/install

      Show
      1/ put block into module and other plugin dir - try upgrade/install 2/ put module into block and other plugin dir - try upgrade/install 3/ put other plugin into block and module dir - try upgrade/install
    • Affected Branches:
      MOODLE_24_STABLE
    • Fixed Branches:
      MOODLE_25_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      w08_MDL-38121_m25_plugincheck

      Description

      Lots of people end up installing plugins in /mod instead of the correct locations/admin tools/plagiarism plugins etc etc.

      it would be nice if upgrade_plugins_modules checked this and gave a useful error instead of the version not readable debugging messages and detectedbrokenplugin

      it would be good to check for $plugin->component as well as the current check for $module->component something like this:

              // if plugin tells us it's full name we may check the location
              if (isset($module->component)) {
                  if ($module->component !== $component) {
                      throw new plugin_defective_exception($component, 'Plugin installed in wrong folder.');
                  }
              } else if (!empty($plugin->component)) {
                  if ($plugin->component !== $component) {
                      throw new plugin_defective_exception($component, 'Plugin installed in wrong folder.');
                  }
              }
      

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              skodak Petr Skoda
              Reporter:
              danmarsden Dan Marsden
              Integrator:
              Dan Poltawski
              Tester:
              Rajesh Taneja
              Participants:
              Component watchers:
              Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Sara Arjona (@sarjona), Víctor Déniz Falcón
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Fix Release Date:
                14/May/13