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

Remove sized files for MIME icons and update them with new SVG files

XMLWordPrintable

    • MOODLE_403_STABLE
    • MOODLE_403_STABLE
    • MDL-78884-master
    • Hide

      Setup

      1. Login as admin
      2. Restore the backup course to your Moodle site: backup-moodle2-file_links_mime_types.mbz
      3. Go to Private files.
      4. Create a folder and upload a few files (at least one jpg/png, one .txt, one .doc and one .zip).
      5. Save changes.

      Before upgrade

      1. Log in as admin.
      2. Go to "Site administration > Server > File types".
      3. Add the following new file types:
        • CustomBMP, with MIME type set to ext/bmp and File icon to "bmp".
        • CustomExplore, with MIME type set to ext/explore and File icon to "explore".
        • CustomAudio, with MIME type set to ext/audio and File icon to "audio".
      4. Check the custom file types are using the proper image for each case (CustomBMP should have the same image that 'image/bmp', CustomExplore should display the explore.gif image, and CustomAudio should display the same icon that 'audio/au').

       

      Testing scenario 1. Upgrade process

      1. Apply the patch.
      2. Login as admin.
      3. Run the upgrade and, during the process, check the "You need to manually check customfiletypes in config.php because some MIME icons have been removed!" text is NOT displayed.
      4. Go to "Site administration > Server > File types".
      5. In the Extension column:
        • Confirm the icons are the new ones (rendered black&white).
        • Confirm the icon size is 32px x 32px.
      6. Edit the CustomBMP file type and check the icon has been replaced with 'image'.
      7. Edit the CustomExplore file type and check the icon has been replaced with 'unknown'.
      8. Edit the CustomAudio file type and check the icon hasn't been changed.

       

      Testing scenario 2. MIME icons on the course page

      1. Login as admin.
      2. Go to the Course restored in the setup.
      3. Check the icon for all the resources in the "MIME icons for URL" section are using the new icons (they should be black&white and more modernised than the ones in https://github.com/moodle/moodle/tree/MOODLE_402_STABLE/pix/f ).
      4. Confirm the activity icon size is 24px x 24px (even for Default URL and Default assignment).
      5. Confirm the icon for the resources in the "Exceptions for the URL icons" section is the Default icon for URL (they are exceptions declared in mod/url, so that's expected and unrelated to the patch).
      6. Click any of the resources in the "MIME icons for URL" section.
      7. Check the activity icon size is 40px x 40px.

       

      Testing scenario 3. MIME icons in Private files

      1. Login as admin.
      2. Go to Private files.
      3. Check the new icons are displayed (when they apply, like the .txt, the .doc or the .zip files).
      4. Switch the different views (File icons vs File details vs File tree) and confirm the icons are resized to the expected size (they should be bigger for the File icons view).

      Testing scenario 4. Upgrade with customfiletypes in config.php

      1. Set the Moodle version to the number before upgrading (for that, you can set the branch to master again, and run mdk run version after that).
      2. Edit config.php and add the following setting:

        $CFG->customfiletypes = [
            (object)[
                'extension' => 'frog',
                'icon' => 'bmp',
                'type' => 'application/frog',
                'customdescription' => 'Amphibian-related file archive'
            ]
        ];

      3. Apply the patch again (or set it to the branch with the patch applied) and run the upgrade process again.
      4. Login as admin.
      5. Run the upgrade and, during the process, check the "You need to manually check customfiletypes in config.php because some MIME icons have been removed!" text is displayed a couple of times.
      Show
      Setup Login as admin Restore the backup course to your Moodle site: backup-moodle2-file_links_mime_types.mbz Go to Private files. Create a folder and upload a few files (at least one jpg/png, one .txt, one .doc and one .zip). Save changes. Before upgrade Log in as admin. Go to "Site administration > Server > File types". Add the following new file types: CustomBMP, with MIME type set to ext/bmp and File icon to "bmp". CustomExplore, with MIME type set to ext/explore and File icon to "explore". CustomAudio, with MIME type set to ext/audio and File icon to "audio". Check the custom file types are using the proper image for each case (CustomBMP should have the same image that 'image/bmp', CustomExplore should display the explore.gif image, and CustomAudio should display the same icon that 'audio/au').   Testing scenario 1. Upgrade process Apply the patch. Login as admin. Run the upgrade and, during the process, check the "You need to manually check customfiletypes in config.php because some MIME icons have been removed!" text is NOT displayed. Go to "Site administration > Server > File types". In the Extension column: Confirm the icons are the new ones (rendered black&white). Confirm the icon size is 32px x 32px. Edit the CustomBMP file type and check the icon has been replaced with 'image'. Edit the CustomExplore file type and check the icon has been replaced with 'unknown'. Edit the CustomAudio file type and check the icon hasn't been changed.   Testing scenario 2. MIME icons on the course page Login as admin. Go to the Course restored in the setup. Check the icon for all the resources in the "MIME icons for URL" section are using the new icons (they should be black&white and more modernised than the ones in https://github.com/moodle/moodle/tree/MOODLE_402_STABLE/pix/f ). Confirm the activity icon size is 24px x 24px (even for Default URL and Default assignment). Confirm the icon for the resources in the "Exceptions for the URL icons" section is the Default icon for URL (they are exceptions declared in mod/url, so that's expected and unrelated to the patch). Click any of the resources in the "MIME icons for URL" section. Check the activity icon size is 40px x 40px.   Testing scenario 3. MIME icons in Private files Login as admin. Go to Private files. Check the new icons are displayed (when they apply, like the .txt, the .doc or the .zip files). Switch the different views (File icons vs File details vs File tree) and confirm the icons are resized to the expected size (they should be bigger for the File icons view). Testing scenario 4. Upgrade with customfiletypes in config.php Set the Moodle version to the number before upgrading (for that, you can set the branch to master again, and run mdk run version after that). Edit config.php and add the following setting: $CFG->customfiletypes = [   (object)[         'extension' => 'frog' ,         'icon' => 'bmp' ,         'type' => 'application/frog' ,         'customdescription' => 'Amphibian-related file archive'   ] ]; Apply the patch again (or set it to the branch with the patch applied) and run the upgrade process again. Login as admin. Run the upgrade and, during the process, check the "You need to manually check customfiletypes in config.php because some MIME icons have been removed!" text is displayed a couple of times.
    • 3
    • HQ 2023 Sprint I3.1 Moppies

      While reviewing MDL-78285 and MDL-75611, it was raised that in order to make it easier to maintain (and update) these icons, it would be better to keep only one single version for each icon (SVG).

      This issue is for:

      • Removing the sized files placed in pix/f. 
      • Deprecating the parameters for defining the size of the icons in file_folder_icon(), file_file_icon(), file_extension_icon() and any other related method.
      • Replacing the icons with the new SVG icons created by the UX team (once these icons are updated, MDL-75611 could be closed).

            sarjona Sara Arjona (@sarjona)
            sarjona Sara Arjona (@sarjona)
            Mikel Martín Corrales Mikel Martín Corrales
            Huong Nguyen Huong Nguyen
            Kim Jared Lucas Kim Jared Lucas
            Votes:
            0 Vote for this issue
            Watchers:
            16 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - 0 minutes
                0m
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 3 days, 5 hours, 18 minutes
                3d 5h 18m

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