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

Install add on fails validation when zip does not contain folder entries

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.5
    • Fix Version/s: 2.5.3
    • Component/s: Installation
    • Labels:
    • Affected Branches:
      MOODLE_25_STABLE
    • Fixed Branches:
      MOODLE_25_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      w45_MDL-42044_m26_zipaddon
    • Workaround:
      Hide

      use some zip packer that adds all directories

      Show
      use some zip packer that adds all directories
    • Testing Instructions:
      Hide
      1. Execute unit tests
      2. Go to Site Administration > Plugins > Install add-ons
      3. Upload the attached poodll version as a Text Filter - note you will need to have upload/php limits of at least 20M.
      4. Check that it passes validation (a debug message is normal)
      5. Confirm that it installs and that you get the config page
      Show
      Execute unit tests Go to Site Administration > Plugins > Install add-ons Upload the attached poodll version as a Text Filter - note you will need to have upload/php limits of at least 20M. Check that it passes validation (a debug message is normal) Confirm that it installs and that you get the config page
    • Story Points:
      3
    • Sprint:
      BACKEND Sprint 6

      Description

      When the auto install add ons validation looks for the /lang/en folder.
      If it does not find it, then validation fails and the plugin cannot be installed.

      Depending on how the add on zip file was created however, there may be no folder entries in the zip file. Just files with the full file path.
      Most unzip apps can handle both ok. To illustrate, the contents of the PoodLL filter which fails validation look a bit like this:
      poodll/lang/en/filter_poodll.php
      poodll/module.js
      poodll/pix/download.gif

      But the ensemble filter zip which passes validation looks like this:
      ensemble/lang/
      ensemble/lang/en/
      ensemble/lang/en/filter_ensemble.php
      ensemble/pix/
      ensemble/pix/icon.png

      The code that does all this in:
      admin/tool/installaddon/classes/validator.php

      And the area that needs to be fixed is in function:
      validate_language_pack

        Attachments

          Activity

            People

            Assignee:
            skodak Petr Skoda
            Reporter:
            jhunt Justin Hunt
            Peer reviewer:
            Eric Merrill Eric Merrill
            Integrator:
            Dan Poltawski Dan Poltawski
            Tester:
            David Monllaó David Monllaó
            Participants:
            Component watchers:
            Matteo Scaramuccia, Andrew Lyons, Dongsheng Cai, Huong Nguyen, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Fix Release Date:
              11/Nov/13