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

Available update plugin deployment fails under Windows

    Details

    • Testing Instructions:
      Hide

      Needs to be tested under Windows in Moodle 2.4 (this won't work in Master I don't think).

      1. Download a plugin (zip) from the Plugins Directory (not Git)
      2. Before installing it, reduce its version in the version.php file
      3. Install the plugin
      4. Visit the Plugins overview page (Site admin > Plugins > Plugins overview)
      5. Click "Check for available plugins"; the newly installed plugin should show an update
      6. Click "Install this update"
      7. Confirm the update
      8. Verify there are no errors during download or update
      9. Go through the normal update process to install the "updated" code
      Show
      Needs to be tested under Windows in Moodle 2.4 (this won't work in Master I don't think). Download a plugin (zip) from the Plugins Directory (not Git) Before installing it, reduce its version in the version.php file Install the plugin Visit the Plugins overview page (Site admin > Plugins > Plugins overview) Click "Check for available plugins"; the newly installed plugin should show an update Click "Install this update" Confirm the update Verify there are no errors during download or update Go through the normal update process to install the "updated" code
    • Affected Branches:
      MOODLE_24_STABLE
    • Fixed Branches:
      MOODLE_24_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-38456-mdeploy-paths

      Description

      I was testing the available update system and went to install a plugin through the new interface. After confirming that I did want to install the new plugin, I was presented with an error...

      Oops! It did it again
       
      Moodle deployment utility had a trouble with your request. See the docs page and the debugging information for more details.
       
      exception 'unauthorized_access_exception' with message 'Unable to read the passphrase file.' in D:\xampp\htdocs\24_integration\mdeploy.php:836
      Stack trace:
      #0 D:\xampp\htdocs\24_integration\mdeploy.php(705): worker->authorize()
      #1 D:\xampp\htdocs\24_integration\mdeploy.php(1390): worker->execute()
      #2 {main}
      

      Looking into the value of the passphase file path I discovered that the system is filtering characters from the path including colons (, which means that paths under Windows are being broken. By allowing colons in paths, I was able to download and install a plugin without any trouble. The change I made was to...

      /mdeploy, line 268

      $raw = preg_replace('~[[:cntrl:]]|[&<>"`\|\':]~u', '', $raw);
      

      ...from which I remove the colon from the regex, so it wouldn't be removed.

      /mdeploy, line 268, altered

      $raw = preg_replace('~[[:cntrl:]]|[&<>"`\|\']~u', '', $raw);
      

        Gliffy Diagrams

          Attachments

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  18/Mar/13