Details

    • Type: Sub-task Sub-task
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 2.4
    • Fix Version/s: 2.4
    • Component/s: Course
    • Labels:
    • Testing Instructions:
      Hide

      1. Clear all caches.
      2. Add some File resources using different file types, one with pdf, one with Word etc. You can drag and drop these into the course if you like.
      2. Verify that the icons shown on the course page for these is correct (pdf, word, etc) and that the icon does not look "blocky" or scaled-up from a lower resolution. The icons shown should be natively 24x24 pixels.

      Show
      1. Clear all caches. 2. Add some File resources using different file types, one with pdf, one with Word etc. You can drag and drop these into the course if you like. 2. Verify that the icons shown on the course page for these is correct (pdf, word, etc) and that the icon does not look "blocky" or scaled-up from a lower resolution. The icons shown should be natively 24x24 pixels.
    • Affected Branches:
      MOODLE_24_STABLE
    • Fixed Branches:
      MOODLE_24_STABLE
    • Rank:
      45205

      Description

      We need to explicitly declare the icon file size rather then depending on the default of 16px.

        Activity

        Hide
        Martin Dougiamas added a comment -
        diff --git a/mod/resource/lib.php b/mod/resource/lib.php
        index b500784..0f2395a 100644
        --- a/mod/resource/lib.php
        +++ b/mod/resource/lib.php
        @@ -256,7 +256,7 @@ function resource_get_coursemodule_info($coursemodule) {
             $files = $fs->get_area_files($context->id, 'mod_resource', 'content', 0, 'sortorder DESC, id ASC', false); // TODO: this is not very efficient!!
             if (count($files) >= 1) {
                 $mainfile = reset($files);
        -        $info->icon = file_file_icon($mainfile);
        +        $info->icon = file_file_icon($mainfile, 24);
                 $resource->mainfile = $mainfile->get_filename();
             }
        
        Show
        Martin Dougiamas added a comment - diff --git a/mod/resource/lib.php b/mod/resource/lib.php index b500784..0f2395a 100644 --- a/mod/resource/lib.php +++ b/mod/resource/lib.php @@ -256,7 +256,7 @@ function resource_get_coursemodule_info($coursemodule) { $files = $fs->get_area_files($context->id, 'mod_resource', 'content', 0, 'sortorder DESC, id ASC', false ); // TODO: this is not very efficient!! if (count($files) >= 1) { $mainfile = reset($files); - $info->icon = file_file_icon($mainfile); + $info->icon = file_file_icon($mainfile, 24); $resource->mainfile = $mainfile->get_filename(); }
        Hide
        Dan Poltawski added a comment -

        I've pushed that patch for you, please could you upate testing instructions

        Show
        Dan Poltawski added a comment - I've pushed that patch for you, please could you upate testing instructions
        Hide
        Mark Nelson added a comment -

        Works as expected. Checked image dimensions as well, all were 24*24.

        Show
        Mark Nelson added a comment - Works as expected. Checked image dimensions as well, all were 24*24.
        Hide
        Eloy Lafuente (stronk7) added a comment -

        Amazed. Inspired. Grateful. That’s how your generosity makes me feel.

        (not really)

        Closing, thanks!

        Show
        Eloy Lafuente (stronk7) added a comment - Amazed. Inspired. Grateful. That’s how your generosity makes me feel. (not really) Closing, thanks!

          People

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

            Dates

            • Created:
              Updated:
              Resolved: