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

Jar files incorrectly described

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.3.3, 2.4.1, 2.5
    • Fix Version/s: 2.3.5, 2.4.2
    • Component/s: Files API
    • Labels:
    • Testing Instructions:
      Hide

      1. Turn editing on for a course.
      2. Drag a .jar file into a course week.
      3. Update settings for the .jar file and ensure that the 'Show size' and 'Show type' options are turned on, then save and return to course.

      EXPECTED:

      The size and type display next to the jar file is similar to: "29.8MB application/java-archive"

      BEFORE THIS FIX:

      Display is similar to: "29.8MB application/zip"

      Show
      1. Turn editing on for a course. 2. Drag a .jar file into a course week. 3. Update settings for the .jar file and ensure that the 'Show size' and 'Show type' options are turned on, then save and return to course. EXPECTED: The size and type display next to the jar file is similar to: "29.8MB application/java-archive" BEFORE THIS FIX: Display is similar to: "29.8MB application/zip"
    • Affected Branches:
      MOODLE_23_STABLE, MOODLE_24_STABLE, MOODLE_25_STABLE
    • Fixed Branches:
      MOODLE_23_STABLE, MOODLE_24_STABLE
    • Pull Master Branch:
      MDL-37395-master

      Description

      In Moodle 2.2, if you uploaded a Java .jar application/library file it was identified as an unknown file type and given the generic file icon. This behaviour was acceptable.

      In Moodle 2.3, this behaviour has changed and Moodle now identifies the jar file as a 'Zip file' with appropriate icon. This can be confusing in cases where we are expecting students to download and run a Java application, but Moodle says it's a zip file. (Jar files are indeed a variant of zip file, but so are lots of things, and it's not very helpful. Kind of like saying that a Word document using one of the xml-based formats is a plain text file - it technically is, but...)

      Behaviour is inconsistent as a result of this change: jar files that were added before the update still have the old icon and no description, whereas new or modified files get the zip icon and description.

      The change is caused by MDL-33144, which makes Moodle use something equivalent to the 'file' command-line application to guess the file type based on its content, when the file extension is not one Moodle knows about.

      I think the best solution is probably to add jar files to the list of types that Moodle actually knows about. Will do a patch for this.

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

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

                  Dates

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