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

File picker "Accepted types" display ignores file extensions it doesn't recognise

XMLWordPrintable

    • MOODLE_403_STABLE
    • MOODLE_404_STABLE
    • Hide
      1. Manually apply the following diff:

        $ git diff
        diff --git a/h5p/classes/form/uploadlibraries_form.php b/h5p/classes/form/uploadlibraries_form.php
        index 829b474a79e..7092e6bc0e7 100644
        --- a/h5p/classes/form/uploadlibraries_form.php
        +++ b/h5p/classes/form/uploadlibraries_form.php
        @@ -41,7 +41,7 @@ class uploadlibraries_form extends \moodleform {
                 $mform->addElement('header', 'settingsheader', get_string('uploadlibraries', 'core_h5p'));
         
                 $filemanageroptions = array(
        -            'accepted_types' => array('.h5p', '.zip'),
        +            'accepted_types' => array('.h5p', '.zip', '.xyz', 'web_image', 'video/mpeg'),
                     'maxbytes' => 0,
                     'maxfiles' => 1,
                     'subdirs' => 0
        

      2. Log in as admin
      3. Navigate to General > H5P > Manage H5P content types in site administration
      4. Confirm the H5P content type file picker shows the following:

         
            Archive (H5P) .h5p
            Archive (ZIP) .zip
            File .xyz
            Image files used on the web .gif .jpe .jpeg .jpg .png .svg .svgz
            Video file (MPEG) .mpe .mpeg .mpg
        

      Show
      Manually apply the following diff: $ git diff diff --git a/h5p/classes/form/uploadlibraries_form.php b/h5p/classes/form/uploadlibraries_form.php index 829b474a79e..7092e6bc0e7 100644 --- a/h5p/classes/form/uploadlibraries_form.php +++ b/h5p/classes/form/uploadlibraries_form.php @@ -41,7 +41,7 @@ class uploadlibraries_form extends \moodleform { $mform->addElement('header', 'settingsheader', get_string('uploadlibraries', 'core_h5p')); $filemanageroptions = array( - 'accepted_types' => array('.h5p', '.zip'), + 'accepted_types' => array('.h5p', '.zip', '.xyz', 'web_image', 'video/mpeg'), 'maxbytes' => 0, 'maxfiles' => 1, 'subdirs' => 0 Log in as admin Navigate to General > H5P > Manage H5P content types in site administration Confirm the H5P content type file picker shows the following:   Archive (H5P) .h5p Archive (ZIP) .zip File .xyz Image files used on the web .gif .jpe .jpeg .jpg .png .svg .svgz Video file (MPEG) .mpe .mpeg .mpg

      Noted by mathewmay in MDL-80088

      +        $mform->addElement('filepicker', 'package', get_string('packagefile', 'imscp'), null,
      +            ['accepted_types' => ['application/zip', '.imscc']]);
      

      The user is not informed that .imscc files are accepted. This is inconsistent with the subsequent validation, because the above filetype is accepted upon form submission

      We should show file extensions under "Accepted file types" regardless of whether Moodle knows about them

        1. filemanager.png
          filemanager.png
          37 kB
        2. filepicker.png
          filepicker.png
          50 kB
        3. MDL-80991.png
          MDL-80991.png
          385 kB
        4. Screenshot 2024-03-08 at 11.59.28 AM.png
          Screenshot 2024-03-08 at 11.59.28 AM.png
          149 kB

            pholden Paul Holden
            pholden Paul Holden
            Pedro Jordao Pedro Jordao
            Ilya Tregubov Ilya Tregubov
            Ron Carl Alfon Yu Ron Carl Alfon Yu
            Votes:
            1 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 1 hour, 11 minutes
                1h 11m

                  Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.