• Icon: Sub-task Sub-task
    • Resolution: Fixed
    • Icon: Blocker Blocker
    • 2.3
    • 2.3
    • Filepicker, Files API

      While working on the thumbnails support, I encountered this very weird bug and can't cope with it. Here are steps to reproduce it at my laptop:

      1. Prepare a checkout of Marina's branch https://github.com/marinaglancy/moodle/compare/master...wip-MDL-31901-master
      2. Apply the following trivial patch:

      diff --git a/lib/filelib.php b/lib/filelib.php
      index 9fcca04..cc24924 100644
      --- a/lib/filelib.php
      +++ b/lib/filelib.php
      @@ -600,6 +600,12 @@ function file_get_drafarea_files($draftitemid, $filepath = '/') {
                       // do NOT use file browser here!
                       $item->url = moodle_url::make_draftfile_url($draftitemid, $item->filepath, $item->filename)->out();
                       $item->thumbnail = $OUTPUT->pix_url(file_extension_icon($item->filename, 32))->out(false);
      +                if ($imageinfo = $file->get_imageinfo()) {
      +                    $item->thumbnail = $item->url;
      +                    $item->icon = $item->url;
      +                }
                   $list[] = $item;

      As you can see, all the patch does is that it forces to use the full-sized image as the icon and the thumbnail.
      3. Create a Folder resource instance.
      4. Edit the folder contents and upload a single image to it.
      5. TEST: The image is used as the 90x90 "thumbnail" (not real thumbnail as it loads the full image but that does not matter now)
      6. Click "View as list" button

      Expected behavior: the image resized to 16x16 "thumbnail" is displayed next to the filename and I can save the Folder contents

      What actually happens: Just after clicking the button, the session is terminated and you are logged out!

      Analysis: somehow, loading draftfile.php from the list view terminates the session. The weird thing is that the 90x90 "thumbnail" image is correctly loaded at the first page via the very same URL and then it does not cases session terminus (in other words, unless you click the "View as list" button, you can safely work with the files).

            marina Marina Glancy
            mudrd8mz David Mudrák (@mudrd8mz)
            0 Vote for this issue
            1 Start watching this issue


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