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

Recognize git submodules as external plugin source

    XMLWordPrintable

    Details

    • Testing Instructions:
      Hide
      1. Install an additional plugin.
      2. Create a new file (can be empty) .git in the root directory of the added plugin.
      3. Make sure to set the permissions for all files in the plugin (including the new .git file) so that the web server process have write access to them all.
      4. Uninstall the plugin.
      5. TEST: When Moodle asks whether it should remove the plugin folder after the uninstallation, there should a warning displayed, that the plugin is probably "git-submodule" checkout (see attached screeshot).
      Show
      Install an additional plugin. Create a new file (can be empty) .git in the root directory of the added plugin. Make sure to set the permissions for all files in the plugin (including the new .git file) so that the web server process have write access to them all. Uninstall the plugin. TEST: When Moodle asks whether it should remove the plugin folder after the uninstallation, there should a warning displayed, that the plugin is probably "git-submodule" checkout (see attached screeshot).
    • Affected Branches:
      MOODLE_26_STABLE, MOODLE_27_STABLE, MOODLE_28_STABLE
    • Fixed Branches:
      MOODLE_26_STABLE, MOODLE_27_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-47411-master-submodules

      Description

      lib\classes\update\deployer.php -> plugin_external_source()
      AND
      lib\classes\plugin_manager.php -> plugin_external_source()
      both check to see if the current version of a plugin is a checkout of an external repository.

      Although this function checks for unique git repositories, it doesn't check for git submodules. Whereas git repositories create a .git directory by default, git submodules create a .git file. Therefore, this improvement might be as simple as changing:

              if (is_dir($pluginroot.'/.git')) {
                  return 'git';
              }
      

      to

              if (file_exists($pluginroot.'/.git')) {
                  return 'git';
              }
      

        Attachments

          Activity

            People

            Assignee:
            mudrd8mz David Mudrák (@mudrd8mz)
            Reporter:
            pjking07 PJ King
            Peer reviewer:
            PJ King
            Integrator:
            Eloy Lafuente (stronk7)
            Tester:
            Dan Poltawski
            Participants:
            Component watchers:
            Matteo Scaramuccia, Andrew Nicols, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze, Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Peter Dias, Sujith Haridasan
            Votes:
            1 Vote for this issue
            Watchers:
            5 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Fix Release Date:
              10/Nov/14